org.axiondb.types
Class BaseNumberDataType

java.lang.Object
  extended by org.axiondb.types.BaseDataType
      extended by org.axiondb.types.BaseNumberDataType
All Implemented Interfaces:
Serializable, Comparator, DataType, DataTypeFactory
Direct Known Subclasses:
BigDecimalType, BigIntType, ByteType, DoubleType, FloatType, IntegerType, ShortType, UnsignedByteType, UnsignedIntegerType, UnsignedShortType

public abstract class BaseNumberDataType
extends BaseDataType

An abstract base DataTypefor Numbertypes.

Version:
$Revision: 1.9 $ $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
BaseNumberDataType()
           
 
Method Summary
 boolean accepts(Object value)
          Returns true iff value is String that can be convertedwithout exception, null, or a Number.
 Object convert(Object value)
          Returns value if value is null and throws IllegalArgumentExceptionotherwise.
 boolean supportsSuccessor()
          This base implementation returns true.
protected  Number toNumber(Object value)
           
 
Methods inherited from class org.axiondb.types.BaseDataType
compare, getColumnDisplaySize, getComparator, getJdbcType, getLiteralPrefix, getLiteralSuffix, getNullableCode, getPrecision, getPrecisionRadix, getPreferredValueClassName, getScale, getSearchableCode, isCaseSensitive, isCurrency, isUnsigned, makeNewInstance, read, successor, toBigDecimal, toBigInteger, toBlob, toBoolean, toByte, toByteArray, toClob, toDate, toDouble, toFloat, toInt, toLong, toShort, toString, toTime, toTimestamp, toURL, write
 
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

BaseNumberDataType

public BaseNumberDataType()
Method Detail

accepts

public boolean accepts(Object value)
Returns true iff value is String that can be convertedwithout exception, null, or a Number.

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

convert

public Object convert(Object value)
               throws AxionException
Returns value if value is null and throws IllegalArgumentExceptionotherwise. Subclasses should override this method and call super.convert(value) as their last case.

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

supportsSuccessor

public boolean supportsSuccessor()
This base implementation returns true.

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

toNumber

protected Number toNumber(Object value)
                   throws AxionException
Overrides:
toNumber in class BaseDataType
Throws:
AxionException