org.axiondb.types
Class VarBinaryType

java.lang.Object
  extended byorg.axiondb.types.BaseDataType
      extended byorg.axiondb.types.VarBinaryType
All Implemented Interfaces:
Comparator, DataType, DataTypeFactory, Serializable

public class VarBinaryType
extends BaseDataType
implements Serializable, Comparator

A DataType representing a BinaryArray value.

Version:
$Revision: 1.6 $ $Date: 2004/09/09 23:47:42 $
See Also:
Serialized Form

Constructor Summary
VarBinaryType()
           
VarBinaryType(int length)
          Creates a new instance of VarBinaryType
 
Method Summary
 boolean accepts(Object value)
          Return true if a field of my type can be assigned the given non-null value, false otherwise.
 int compare(Object a, Object b)
           
 Object convert(Object value)
          Converts an acceptable value to one of the appropriate type.
 Comparator getComparator()
          This base implementation simply returns a ComparableComparator.
 int getJdbcType()
          Returns Types.VARBINARY.
 DataType makeNewInstance()
           
 Object read(DataInput in)
          Instantiate an object of my type from the given DataInput.
 void setLength(int length)
           
 Object successor(Object value)
          Returns the successor for the given value.
 boolean supportsSuccessor()
          Returns true if the successor(java.lang.Object)method is supported, false otherwise.
 byte[] toByteArray(Object value)
          Convert the given non- null value to a byte[], or throw a AxionException.
 String toString(Object value)
          Convert the given non- null value to a String, or throw a AxionException.
 void write(Object value, DataOutput out)
          Write an object of my type to the given DataOutput.
 
Methods inherited from class org.axiondb.types.BaseDataType
getColumnDisplaySize, getLiteralPrefix, getLiteralSuffix, getNullableCode, getPrecision, getPreferredValueClassName, getScale, getSearchableCode, isCaseSensitive, isCurrency, isUnsigned, toBigDecimal, toBigInteger, toBlob, toBoolean, toByte, toClob, toDate, toDouble, toFloat, toInt, toLong, toNumber, toShort, toTime, toTimestamp, toURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

VarBinaryType

public VarBinaryType()

VarBinaryType

public VarBinaryType(int length)
Creates a new instance of VarBinaryType

Method Detail

setLength

public void setLength(int length)

accepts

public boolean accepts(Object value)
Return true if a field of my type can be assigned the given non-null value, false otherwise.

Specified by:
accepts in interface DataType
Specified by:
accepts in class BaseDataType
Parameters:
value - non-null value

supportsSuccessor

public boolean supportsSuccessor()
Description copied from interface: DataType
Returns true if the DataType.successor(java.lang.Object)method is supported, false otherwise.

Specified by:
supportsSuccessor in interface DataType
Overrides:
supportsSuccessor in class BaseDataType

successor

public Object successor(Object value)
                 throws IllegalArgumentException
Description copied from interface: DataType
Returns the successor for the given value. For example, the successor of the integer 1 is 2.

Specified by:
successor in interface DataType
Overrides:
successor in class BaseDataType
Throws:
IllegalArgumentException

convert

public Object convert(Object value)
Converts an acceptable value to one of the appropriate type.

Specified by:
convert in interface DataType
Specified by:
convert in class BaseDataType

toByteArray

public byte[] toByteArray(Object value)
                   throws AxionException
Description copied from interface: DataType
Convert the given non- null value to a byte[], or throw a AxionException.

Specified by:
toByteArray in interface DataType
Overrides:
toByteArray in class BaseDataType
Throws:
AxionException

getJdbcType

public int getJdbcType()
Returns Types.VARBINARY.

Specified by:
getJdbcType in interface DataType
Specified by:
getJdbcType in class BaseDataType

makeNewInstance

public DataType makeNewInstance()
Specified by:
makeNewInstance in interface DataTypeFactory
Specified by:
makeNewInstance in class BaseDataType

read

public Object read(DataInput in)
            throws IOException
Instantiate an object of my type from the given DataInput. The next sequence of bytes to be read from the DataInput will have been written by write(java.lang.Object, java.io.DataOutput).

Specified by:
read in interface DataType
Specified by:
read in class BaseDataType
Throws:
IOException

write

public void write(Object value,
                  DataOutput out)
           throws IOException
Write an object of my type to the given DataOutput.

Specified by:
write in interface DataType
Specified by:
write in class BaseDataType
Parameters:
value - the value to write, which must be acceptable to this DataType
Throws:
IOException

toString

public String toString(Object value)
Description copied from interface: DataType
Convert the given non- null value to a String, or throw a AxionException.

Specified by:
toString in interface DataType
Overrides:
toString in class BaseDataType

getComparator

public Comparator getComparator()
Description copied from class: BaseDataType
This base implementation simply returns a ComparableComparator.

Overrides:
getComparator in class BaseDataType

compare

public int compare(Object a,
                   Object b)
            throws ClassCastException
Specified by:
compare in interface Comparator
Overrides:
compare in class BaseDataType
Throws:
ClassCastException