org.axiondb
public interface DataType extends Comparator, Serializable
Responsible for testing
that a value is assignable to fields of this
type, for converting
Object Objects
to this type, and for
reading
values from and writing
values to a stream.
Version: $Revision: 1.14 $ $Date: 2005/05/02 22:17:47 $
Nested Class Summary | |
---|---|
static interface | DataType.BinaryRepresentation
Extension of DataType to indicate that the implementing class stores binary values,
and as such returns precision as the number of bits used to represent a given
value.
|
static interface | DataType.ExactNumeric
Extension of NonFixedPrecision to indicate that the scale of the implementing class
is not fixed by the implementation, but rather can be declared by the user.
|
static interface | DataType.NonFixedPrecision
Extension of DataType to indicate that the precision of the implementing class is
not fixed by the implementation, but rather can be declared by the user.
|
Method Summary | |
---|---|
boolean | accepts(Object value)
Return true if a field of my type can be assigned the given non-
null value , false otherwise.
|
Object | convert(Object value)
Converts an acceptable value to one of the appropriate type.
|
int | getColumnDisplaySize()
Value returned by ResultSetMetaData#getColumnDisplaySizefor this data
type.
|
int | getJdbcType()
Returns the JDBC java.sql.Types type code most closely matching this type. |
String | getLiteralPrefix()
Prefix used to quote a literal to delimit value for this type when in SQL syntax or
result display
|
String | getLiteralSuffix()
Suffix used to quote a literal to delimit value for this type when in SQL syntax or
result display
|
int | getNullableCode()
Code indicating that type does not accept, does accept, or does not disclose
acceptance of null values
|
int | getPrecision()
Value returned by ResultSetMetaData#getPrecisionfor this data type.
|
int | getPrecisionRadix()
Indicates radix used to compute maximum number of significant digits for this
datatype, as returned by DataType.
|
String | getPreferredValueClassName()
Returns the "normal" type returned by DataType. |
int | getScale()
Value returned by ResultSetMetaData#getScalefor this data type.
|
short | getSearchableCode()
Code indicating how much WHERE ... |
boolean | isCaseSensitive()
For character and string-related types, indicates whether type acknowledges case
when storing and retrieving values
|
boolean | isCurrency() |
boolean | isUnsigned()
For numeric types, indicates whether type stores only non-negative (>= 0) values
|
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. |
boolean | supportsSuccessor()
Returns true if the DataTypemethod is supported, false
otherwise. |
BigDecimal | toBigDecimal(Object value) |
BigInteger | toBigInteger(Object value) |
Blob | toBlob(Object value)
Convert the given non- null value to a Blob, or
throw a AxionException.
|
boolean | toBoolean(Object value)
Convert the given non- null value to a boolean ,
or throw a SQLException.
|
byte | toByte(Object value)
Convert the given non- null value to a byte ,
or throw a SQLException.
|
byte[] | toByteArray(Object value) |
Clob | toClob(Object value)
Convert the given non- null value to a Clob, or
throw a AxionException.
|
Date | toDate(Object value)
Convert the given non- null value to a java.sql.Date,
or throw a SQLException.
|
double | toDouble(Object value) |
float | toFloat(Object value) |
int | toInt(Object value) |
long | toLong(Object value) |
short | toShort(Object value) |
String | toString(Object value)
Convert the given non- null value to a String, or
throw a AxionException.
|
Time | toTime(Object value)
Convert the given non- null value to a Time, or
throw a AxionException.
|
Timestamp | toTimestamp(Object value)
Convert the given non- null value to a Timestamp,
or throw a AxionException.
|
URL | toURL(Object value)
Convert the given non- null value to a URL, or
throw a AxionException.
|
void | write(Object value, DataOutput out)
Write an object of my type to the given DataOutput.
|
true
if a field of my type can be assigned the given non-
null
value , false
otherwise.
Parameters: value non- null
value
acceptable
value to one of the appropriate type.
Throws: AxionException
See Also: java.sql.ResultSetMetaData#getColumnDisplaySize
java.sql.Types type code
most closely matching this type.See Also: java.sql.DatabaseMetaData#getTypeInfo
See Also: java.sql.DatabaseMetaData#getTypeInfo
null
values
See Also: java.sql.DatabaseMetaData#getTypeInfo
See Also: java.sql.ResultSetMetaData#getPrecision
Returns: radix used to compute value of DataType, typically 2 or 10.
See Also: java.sql.ResultSetMetaData#getColumnClassName
See Also: java.sql.ResultSetMetaData#getScale
WHERE ... LIKE
support is available across
a column of this type
See Also: java.sql.DatabaseMetaData#getTypeInfo
See Also: java.sql.DatabaseMetaData#getTypeInfo java.sql.ResultSetMetaData#isCaseSensitive
See Also: java.sql.ResultSetMetaData#isCurrency
See Also: java.sql.DatabaseMetaData#getTypeInfo
Returns: new instance of this DataType implementation.
DataInput
will have been
written by DataType.true
if the DataTypemethod is supported, false
otherwise.null
value to a
BigDecimal
, or throw a AxionException.
See Also: java.sql.ResultSet#getBigDecimal
null
value to a
BigInteger
, or throw a AxionException.
See Also: java.sql.ResultSet#getBigInteger
null
value to a Blob, or
throw a AxionException.
See Also: java.sql.ResultSet#getBlob
null
value to a boolean
,
or throw a SQLException.
See Also: java.sql.ResultSet#getBoolean
null
value to a byte
,
or throw a SQLException.
See Also: java.sql.ResultSet#getByte
null
value to a byte[]
,
or throw a AxionException.
See Also: java.sql.ResultSet#getBytes
null
value to a Clob, or
throw a AxionException.
See Also: java.sql.ResultSet#getClob
null
value to a java.sql.Date,
or throw a SQLException.
See Also: java.sql.ResultSet#getDate
null
value to a double
,
or throw a AxionException.
See Also: java.sql.ResultSet#getDouble
null
value to a float
,
or throw a AxionException.
See Also: java.sql.ResultSet#getFloat
null
value to a int
,
or throw a AxionException.
See Also: java.sql.ResultSet#getInt
null
value to a long
,
or throw a AxionException.
See Also: java.sql.ResultSet#getLong
null
value to a short
,
or throw a AxionException.
See Also: java.sql.ResultSet#getShort
null
value to a String, or
throw a AxionException.
See Also: java.sql.ResultSet#getString
null
value to a Time, or
throw a AxionException.
See Also: java.sql.ResultSet#getTime
null
value to a Timestamp,
or throw a AxionException.
See Also: java.sql.ResultSet#getTimestamp
null
value to a URL, or
throw a AxionException.
See Also: java.sql.ResultSet#getURL
Parameters: value the value to write, which must be acceptable
to this
DataType