|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.axiondb.types.BaseDataType
org.axiondb.types.AnyType
public class AnyType
Generic implemention of DataType
, for use by BindVariable
.
Field Summary | |
---|---|
static AnyType |
INSTANCE
|
Constructor Summary | |
---|---|
AnyType()
|
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 |
getJdbcType()
Returns the JDBC type code most closely matching this type. |
String |
getPreferredValueClassName()
Returns the "normal" type returned by DataType.convert(java.lang.Object) . |
DataType |
makeNewInstance()
|
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 DataType.successor(java.lang.Object) method is supported, false
otherwise. |
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)
Convert the given non- null value to a byte[] ,
or throw a AxionException . |
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 Date ,
or throw a SQLException . |
double |
toDouble(Object value)
Convert the given non- null value to a double ,
or throw a AxionException . |
float |
toFloat(Object value)
Convert the given non- null value to a float ,
or throw a AxionException . |
int |
toInt(Object value)
Convert the given non- null value to a int ,
or throw a AxionException . |
long |
toLong(Object value)
Convert the given non- null value to a long ,
or throw a AxionException . |
protected Number |
toNumber(Object value)
|
short |
toShort(Object value)
Convert the given non- null value to a short ,
or throw a AxionException . |
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 . |
void |
write(Object value,
DataOutput out)
Write an object of my type to the given DataOutput . |
Methods inherited from class org.axiondb.types.BaseDataType |
---|
compare, getColumnDisplaySize, getComparator, getLiteralPrefix, getLiteralSuffix, getNullableCode, getPrecision, getScale, getSearchableCode, isCaseSensitive, isCurrency, isUnsigned, toBigDecimal, toBigInteger, toURL |
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 |
Field Detail |
---|
public static final AnyType INSTANCE
Constructor Detail |
---|
public AnyType()
Method Detail |
---|
public DataType makeNewInstance()
makeNewInstance
in interface DataTypeFactory
makeNewInstance
in class BaseDataType
public boolean accepts(Object value)
DataType
true
if a field of my type can be assigned the given non-
null
value , false
otherwise.
accepts
in interface DataType
accepts
in class BaseDataType
value
- non- null
valuepublic Object convert(Object value)
DataType
acceptable
value to one of the appropriate type.
convert
in interface DataType
convert
in class BaseDataType
public Object read(DataInput in) throws IOException
DataType
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)
.
read
in interface DataType
read
in class BaseDataType
IOException
public void write(Object value, DataOutput out) throws IOException
DataType
DataOutput
.
write
in interface DataType
write
in class BaseDataType
value
- the value to write, which must be acceptable
to this
DataType
IOException
public int getJdbcType()
DataType
type code
most closely matching this type.
getJdbcType
in interface DataType
getJdbcType
in class BaseDataType
public String getPreferredValueClassName()
DataType
DataType.convert(java.lang.Object)
. Returns
java.lang.Object if unknown.
getPreferredValueClassName
in interface DataType
getPreferredValueClassName
in class BaseDataType
AxionResultSetMetaData.getColumnClassName(int)
public boolean supportsSuccessor()
DataType
true
if the DataType.successor(java.lang.Object)
method is supported, false
otherwise.
supportsSuccessor
in interface DataType
supportsSuccessor
in class BaseDataType
public Object successor(Object value) throws IllegalArgumentException
DataType
successor
in interface DataType
successor
in class BaseDataType
IllegalArgumentException
protected Number toNumber(Object value) throws AxionException
toNumber
in class BaseDataType
AxionException
public boolean toBoolean(Object value) throws AxionException
DataType
null
value to a boolean
,
or throw a SQLException
.
toBoolean
in interface DataType
toBoolean
in class BaseDataType
AxionException
ResultSet.getBoolean(int)
public byte toByte(Object value) throws AxionException
DataType
null
value to a byte
,
or throw a SQLException
.
toByte
in interface DataType
toByte
in class BaseDataType
AxionException
ResultSet.getByte(int)
public byte[] toByteArray(Object value) throws AxionException
DataType
null
value to a byte[]
,
or throw a AxionException
.
toByteArray
in interface DataType
toByteArray
in class BaseDataType
AxionException
ResultSet.getBytes(int)
public double toDouble(Object value) throws AxionException
DataType
null
value to a double
,
or throw a AxionException
.
toDouble
in interface DataType
toDouble
in class BaseDataType
AxionException
ResultSet.getDouble(int)
public float toFloat(Object value) throws AxionException
DataType
null
value to a float
,
or throw a AxionException
.
toFloat
in interface DataType
toFloat
in class BaseDataType
AxionException
ResultSet.getFloat(int)
public int toInt(Object value) throws AxionException
DataType
null
value to a int
,
or throw a AxionException
.
toInt
in interface DataType
toInt
in class BaseDataType
AxionException
ResultSet.getInt(int)
public long toLong(Object value) throws AxionException
DataType
null
value to a long
,
or throw a AxionException
.
toLong
in interface DataType
toLong
in class BaseDataType
AxionException
ResultSet.getLong(int)
public short toShort(Object value) throws AxionException
DataType
null
value to a short
,
or throw a AxionException
.
toShort
in interface DataType
toShort
in class BaseDataType
AxionException
ResultSet.getShort(int)
public String toString(Object value) throws AxionException
DataType
null
value to a String
, or
throw a AxionException
.
toString
in interface DataType
toString
in class BaseDataType
AxionException
ResultSet.getString(int)
public Date toDate(Object value) throws AxionException
DataType
null
value to a Date
,
or throw a SQLException
.
toDate
in interface DataType
toDate
in class BaseDataType
AxionException
ResultSet.getDate(int)
public Time toTime(Object value) throws AxionException
DataType
null
value to a Time
, or
throw a AxionException
.
toTime
in interface DataType
toTime
in class BaseDataType
AxionException
ResultSet.getTime(int)
public Timestamp toTimestamp(Object value) throws AxionException
DataType
null
value to a Timestamp
,
or throw a AxionException
.
toTimestamp
in interface DataType
toTimestamp
in class BaseDataType
AxionException
ResultSet.getTimestamp(int)
public Clob toClob(Object value) throws AxionException
DataType
null
value to a Clob
, or
throw a AxionException
.
toClob
in interface DataType
toClob
in class BaseDataType
AxionException
ResultSet.getClob(int)
public Blob toBlob(Object value) throws AxionException
DataType
null
value to a Blob
, or
throw a AxionException
.
toBlob
in interface DataType
toBlob
in class BaseDataType
AxionException
ResultSet.getBlob(int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |