org.axiondb.types
Class BaseNumberDataType
java.lang.Object
org.axiondb.types.BaseDataType
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 DataType
for Number
types.
- Version:
- $Revision: 1.9 $ $Date: 2005/05/02 22:29:40 $
- See Also:
- Serialized Form
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 |
BaseNumberDataType
public BaseNumberDataType()
accepts
public boolean accepts(Object value)
- Returns
true
iff value is String
that can be
converted
without 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
IllegalArgumentException
otherwise. 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