org.axiondb.types
Class IntegerType

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

public class IntegerType
extends BaseNumberDataType

A DataTyperepresenting an integer value.

Version:
$Revision: 1.10 $ $Date: 2005/05/02 22:29:40 $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.axiondb.DataType
DataType.BinaryRepresentation, DataType.ExactNumeric, DataType.NonFixedPrecision
 
Constructor Summary
IntegerType()
           
 
Method Summary
 int compare(Object a, Object b)
           
 Object convert(Object value)
          Returns an Integerconverted from the given value , or throws IllegalArgumentExceptionif the given value isn't acceptable.
 int getColumnDisplaySize()
          Value returned by ResultSetMetaData#getColumnDisplaySizefor this data type.
protected  Comparator getComparator()
          This base implementation simply returns a ComparableComparator.
 int getJdbcType()
          Returns the JDBC type codemost closely matching this type.
 int getPrecision()
          Value returned by ResultSetMetaData#getPrecisionfor this data type.
 String getPreferredValueClassName()
          Returns the "normal" type returned by DataType.convert(java.lang.Object).
 DataType makeNewInstance()
          Creates a new instance of this DataType implementation.
 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.
 String toString()
          Returns "integer"
 void write(Object value, DataOutput out)
          Writes the given value to the given DataOutput.
 
Methods inherited from class org.axiondb.types.BaseNumberDataType
accepts, supportsSuccessor, toNumber
 
Methods inherited from class org.axiondb.types.BaseDataType
getLiteralPrefix, getLiteralSuffix, getNullableCode, getPrecisionRadix, getScale, getSearchableCode, isCaseSensitive, isCurrency, isUnsigned, toBigDecimal, toBigInteger, toBlob, toBoolean, toByte, toByteArray, toClob, toDate, toDouble, toFloat, toInt, toLong, 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

IntegerType

public IntegerType()
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)

getPrecision

public int getPrecision()
Description copied from interface: DataType
Value returned by ResultSetMetaData#getPrecisionfor this data type.

Specified by:
getPrecision in interface DataType
Overrides:
getPrecision in class BaseDataType
See Also:
ResultSetMetaData.getPrecision(int)

getColumnDisplaySize

public int getColumnDisplaySize()
Description copied from interface: DataType
Value returned by ResultSetMetaData#getColumnDisplaySizefor this data type.

Specified by:
getColumnDisplaySize in interface DataType
Overrides:
getColumnDisplaySize in class BaseDataType
See Also:
ResultSetMetaData.getColumnDisplaySize(int)

toString

public String toString()
Returns "integer"

Overrides:
toString in class Object
Returns:
"integer"

convert

public Object convert(Object value)
               throws AxionException
Returns an Integerconverted from the given value , or throws IllegalArgumentExceptionif the given value isn't acceptable.

Specified by:
convert in interface DataType
Overrides:
convert in class BaseNumberDataType
Throws:
AxionException

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 Integer.MIN_VALUE, false.Integer.MIN_VALUE values are written as Integer.MIN_VALUE,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()
Description copied from interface: DataType
Creates a new instance of this DataType implementation.

Specified by:
makeNewInstance in interface DataType
Specified by:
makeNewInstance in interface DataTypeFactory
Specified by:
makeNewInstance in class BaseDataType
Returns:
new instance of this DataType implementation.

compare

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

getComparator

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

Overrides:
getComparator in class BaseDataType