org.axiondb.types
Class ObjectType

java.lang.Object
  extended by org.axiondb.types.BaseDataType
      extended by org.axiondb.types.ObjectType
All Implemented Interfaces:
Serializable, Comparator, DataType, DataTypeFactory

public class ObjectType
extends BaseDataType

A DataType representing a Serializable object value.

Version:
$Revision: 1.2 $ $Date: 2002/07/02 21:04:57 $
See Also:
Serialized Form

Constructor Summary
ObjectType()
           
 
Method Summary
 boolean accepts(Object value)
          Returns true iff value is null or a Serializable.object
 Object convert(Object value)
          Returns a String converted from the given value, or throws IllegalArgumentException if the given value isn't acceptable.
 int getJdbcType()
          Returns the JDBC type codemost closely matching this type.
 String getPreferredValueClassName()
          Returns the "normal" type returned by DataType.convert(java.lang.Object).
 DataType makeNewInstance()
           
 Object read(DataInput in)
          Instantiate an object of my type from the given DataInput.
 Object successor(Object value)
          Returns the successor for the given value.
 boolean supportsSuccessor()
          Returns true if the DataType.successor(java.lang.Object)method is supported, false otherwise.
 String toString()
          Returns "string"
 void write(Object value, DataOutput out)
          Writes the given value to the given DataOutput.
 
Methods inherited from class org.axiondb.types.BaseDataType
compare, getColumnDisplaySize, getComparator, getLiteralPrefix, getLiteralSuffix, getNullableCode, getPrecision, getScale, getSearchableCode, isCaseSensitive, isCurrency, isUnsigned, toBigDecimal, toBigInteger, toBlob, toBoolean, toByte, toByteArray, toClob, toDate, toDouble, toFloat, toInt, toLong, toNumber, toShort, toString, toTime, toTimestamp, toURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

ObjectType

public ObjectType()
Method Detail

getJdbcType

public int getJdbcType()
Description copied from interface: DataType
Returns the JDBC type codemost closely matching this type.

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

getPreferredValueClassName

public String getPreferredValueClassName()
Description copied from interface: DataType
Returns the "normal" type returned by DataType.convert(java.lang.Object). Returns java.lang.Object if unknown.

Specified by:
getPreferredValueClassName in interface DataType
Overrides:
getPreferredValueClassName in class BaseDataType
See Also:
AxionResultSetMetaData.getColumnClassName(int)

toString

public String toString()
Returns "string"

Overrides:
toString in class Object
Returns:
"string"

accepts

public boolean accepts(Object value)
Returns true iff value is null or a Serializable.object

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

convert

public Object convert(Object value)
               throws IllegalArgumentException
Returns a String converted from the given value, or throws IllegalArgumentException if the given value isn't acceptable.

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

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

read

public Object read(DataInput in)
            throws IOException
Description copied from interface: DataType
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 DataType.write(java.lang.Object, java.io.DataOutput).

Specified by:
read in interface DataType
Specified by:
read in class BaseDataType
Throws:
IOException
See Also:
write(java.lang.Object, java.io.DataOutput)

write

public void write(Object value,
                  DataOutput out)
           throws IOException
Writes the given value to the given DataOutput. Null values are written as "null", false, the non-null String "null" is written as "null", true, all other values are written directly.

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

makeNewInstance

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