|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axiondb.types.BaseDataType
public abstract class BaseDataType
Abstract base implemention of DataType.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.axiondb.DataType |
|---|
DataType.BinaryRepresentation, DataType.ExactNumeric, DataType.NonFixedPrecision |
| Constructor Summary | |
|---|---|
BaseDataType()
|
|
| Method Summary | |
|---|---|
abstract boolean |
accepts(java.lang.Object value)
Return true if a field of my type can be assigned the given non-
null value , false otherwise. |
int |
compare(java.lang.Object a,
java.lang.Object b)
|
abstract java.lang.Object |
convert(java.lang.Object value)
Converts an acceptablevalue to one of the appropriate type. |
int |
getColumnDisplaySize()
Value returned by ResultSetMetaData#getColumnDisplaySizefor this data
type. |
protected java.util.Comparator |
getComparator()
This base implementation simply returns a ComparableComparator. |
abstract int |
getJdbcType()
Returns the JDBC type codemost closely matching this type. |
java.lang.String |
getLiteralPrefix()
Prefix used to quote a literal to delimit value for this type when in SQL syntax or result display |
java.lang.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.getPrecision(). |
java.lang.String |
getPreferredValueClassName()
Returns the "normal" type returned by DataType.convert(java.lang.Object). |
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 |
abstract DataType |
makeNewInstance()
Creates a new instance of this DataType implementation. |
abstract java.lang.Object |
read(java.io.DataInput in)
Instantiate an object of my type from the given DataInput. |
java.lang.Object |
successor(java.lang.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. |
java.math.BigDecimal |
toBigDecimal(java.lang.Object value)
Convert the given non- null value to a
BigDecimal, or throw a AxionException. |
java.math.BigInteger |
toBigInteger(java.lang.Object value)
Convert the given non- null value to a
BigInteger, or throw a AxionException. |
java.sql.Blob |
toBlob(java.lang.Object value)
Convert the given non- null value to a Blob, or
throw a AxionException. |
boolean |
toBoolean(java.lang.Object value)
Convert the given non- null value to a boolean,
or throw a SQLException. |
byte |
toByte(java.lang.Object value)
Convert the given non- null value to a byte,
or throw a SQLException. |
byte[] |
toByteArray(java.lang.Object value)
Convert the given non- null value to a byte[],
or throw a AxionException. |
java.sql.Clob |
toClob(java.lang.Object value)
Convert the given non- null value to a Clob, or
throw a AxionException. |
java.sql.Date |
toDate(java.lang.Object value)
Convert the given non- null value to a Date,
or throw a SQLException. |
double |
toDouble(java.lang.Object value)
Convert the given non- null value to a double,
or throw a AxionException. |
float |
toFloat(java.lang.Object value)
Convert the given non- null value to a float,
or throw a AxionException. |
int |
toInt(java.lang.Object value)
Convert the given non- null value to a int,
or throw a AxionException. |
long |
toLong(java.lang.Object value)
Convert the given non- null value to a long,
or throw a AxionException. |
protected java.lang.Number |
toNumber(java.lang.Object value)
|
short |
toShort(java.lang.Object value)
Convert the given non- null value to a short,
or throw a AxionException. |
java.lang.String |
toString(java.lang.Object value)
Convert the given non- null value to a String, or
throw a AxionException. |
java.sql.Time |
toTime(java.lang.Object value)
Convert the given non- null value to a Time, or
throw a AxionException. |
java.sql.Timestamp |
toTimestamp(java.lang.Object value)
Convert the given non- null value to a Timestamp,
or throw a AxionException. |
java.net.URL |
toURL(java.lang.Object value)
Convert the given non- null value to a URL, or
throw a AxionException. |
abstract void |
write(java.lang.Object value,
java.io.DataOutput out)
Write an object of my type to the given DataOutput. |
| 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 |
|---|
public BaseDataType()
| Method Detail |
|---|
public abstract DataType makeNewInstance()
DataType
makeNewInstance in interface DataTypemakeNewInstance in interface DataTypeFactorypublic abstract boolean accepts(java.lang.Object value)
DataTypetrue if a field of my type can be assigned the given non-
null value , false otherwise.
accepts in interface DataTypevalue - non- null value
public abstract java.lang.Object convert(java.lang.Object value)
throws AxionException
DataTypeacceptablevalue to one of the appropriate type.
convert in interface DataTypeAxionException
public abstract java.lang.Object read(java.io.DataInput in)
throws java.io.IOException
DataTypeDataInput. The next
sequence of bytes to be read from the DataInput will have been
written by DataType.write(java.lang.Object, java.io.DataOutput).
read in interface DataTypejava.io.IOException
public abstract void write(java.lang.Object value,
java.io.DataOutput out)
throws java.io.IOException
DataTypeDataOutput.
write in interface DataTypevalue - the value to write, which must be acceptableto this
DataType
java.io.IOExceptionpublic abstract int getJdbcType()
DataTypetype codemost closely matching this type.
getJdbcType in interface DataTypepublic java.lang.String getPreferredValueClassName()
DataTypeDataType.convert(java.lang.Object). Returns
java.lang.Object if unknown.
getPreferredValueClassName in interface DataTypeAxionResultSetMetaData.getColumnClassName(int)
public int compare(java.lang.Object a,
java.lang.Object b)
compare in interface java.util.Comparatorprotected java.util.Comparator getComparator()
ComparableComparator.
public int getColumnDisplaySize()
DataTypeResultSetMetaData#getColumnDisplaySizefor this data
type.
getColumnDisplaySize in interface DataTypeResultSetMetaData.getColumnDisplaySize(int)public int getPrecision()
DataTypeResultSetMetaData#getPrecisionfor this data type.
getPrecision in interface DataTypeResultSetMetaData.getPrecision(int)public int getScale()
DataTypeResultSetMetaData#getScalefor this data type.
getScale in interface DataTypeResultSetMetaData.getScale(int)public boolean isCaseSensitive()
DataType
isCaseSensitive in interface DataTypeDatabaseMetaData.getTypeInfo(),
ResultSetMetaData.isCaseSensitive(int)public boolean isCurrency()
isCurrency in interface DataTypeResultSetMetaData.isCurrency(int)public java.lang.String getLiteralPrefix()
DataType
getLiteralPrefix in interface DataTypeDatabaseMetaData.getTypeInfo()public java.lang.String getLiteralSuffix()
DataType
getLiteralSuffix in interface DataTypeDatabaseMetaData.getTypeInfo()public int getNullableCode()
DataTypenull values
getNullableCode in interface DataTypeDatabaseMetaData.getTypeInfo()public short getSearchableCode()
DataTypeWHERE ... LIKE support is available across
a column of this type
getSearchableCode in interface DataTypeDatabaseMetaData.getTypeInfo()public boolean isUnsigned()
DataType
isUnsigned in interface DataTypeDatabaseMetaData.getTypeInfo()public boolean supportsSuccessor()
DataTypetrue if the DataType.successor(java.lang.Object)method is supported, false
otherwise.
supportsSuccessor in interface DataType
public java.lang.Object successor(java.lang.Object value)
throws java.lang.IllegalArgumentException
DataType
successor in interface DataTypejava.lang.IllegalArgumentExceptionpublic int getPrecisionRadix()
DataTypeDataType.getPrecision().
getPrecisionRadix in interface DataTypeDataType.getPrecision(), typically 2 or 10.
protected java.lang.Number toNumber(java.lang.Object value)
throws AxionException
AxionException
public java.math.BigDecimal toBigDecimal(java.lang.Object value)
throws AxionException
DataTypenull value to a
BigDecimal, or throw a AxionException.
toBigDecimal in interface DataTypeAxionExceptionResultSet.getBigDecimal(int, int)
public java.math.BigInteger toBigInteger(java.lang.Object value)
throws AxionException
DataTypenull value to a
BigInteger, or throw a AxionException.
toBigInteger in interface DataTypeAxionExceptionjava.sql.ResultSet#getBigInteger
public boolean toBoolean(java.lang.Object value)
throws AxionException
DataTypenull value to a boolean,
or throw a SQLException.
toBoolean in interface DataTypeAxionExceptionResultSet.getBoolean(int)
public byte toByte(java.lang.Object value)
throws AxionException
DataTypenull value to a byte,
or throw a SQLException.
toByte in interface DataTypeAxionExceptionResultSet.getByte(int)
public byte[] toByteArray(java.lang.Object value)
throws AxionException
DataTypenull value to a byte[],
or throw a AxionException.
toByteArray in interface DataTypeAxionExceptionResultSet.getBytes(int)
public java.sql.Date toDate(java.lang.Object value)
throws AxionException
DataTypenull value to a Date,
or throw a SQLException.
toDate in interface DataTypeAxionExceptionResultSet.getDate(int)
public double toDouble(java.lang.Object value)
throws AxionException
DataTypenull value to a double,
or throw a AxionException.
toDouble in interface DataTypeAxionExceptionResultSet.getDouble(int)
public float toFloat(java.lang.Object value)
throws AxionException
DataTypenull value to a float,
or throw a AxionException.
toFloat in interface DataTypeAxionExceptionResultSet.getFloat(int)
public int toInt(java.lang.Object value)
throws AxionException
DataTypenull value to a int,
or throw a AxionException.
toInt in interface DataTypeAxionExceptionResultSet.getInt(int)
public long toLong(java.lang.Object value)
throws AxionException
DataTypenull value to a long,
or throw a AxionException.
toLong in interface DataTypeAxionExceptionResultSet.getLong(int)
public short toShort(java.lang.Object value)
throws AxionException
DataTypenull value to a short,
or throw a AxionException.
toShort in interface DataTypeAxionExceptionResultSet.getShort(int)
public java.lang.String toString(java.lang.Object value)
throws AxionException
DataTypenull value to a String, or
throw a AxionException.
toString in interface DataTypeAxionExceptionResultSet.getString(int)
public java.net.URL toURL(java.lang.Object value)
throws AxionException
DataTypenull value to a URL, or
throw a AxionException.
toURL in interface DataTypeAxionExceptionResultSet.getURL(int)
public java.sql.Time toTime(java.lang.Object value)
throws AxionException
DataTypenull value to a Time, or
throw a AxionException.
toTime in interface DataTypeAxionExceptionResultSet.getTime(int)
public java.sql.Timestamp toTimestamp(java.lang.Object value)
throws AxionException
DataTypenull value to a Timestamp,
or throw a AxionException.
toTimestamp in interface DataTypeAxionExceptionResultSet.getTimestamp(int)
public java.sql.Clob toClob(java.lang.Object value)
throws AxionException
DataTypenull value to a Clob, or
throw a AxionException.
toClob in interface DataTypeAxionExceptionResultSet.getClob(int)
public java.sql.Blob toBlob(java.lang.Object value)
throws AxionException
DataTypenull value to a Blob, or
throw a AxionException.
toBlob in interface DataTypeAxionExceptionResultSet.getBlob(int)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||