|
||||||||||
| 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.TimestampType
org.axiondb.types.TimeType
public class TimeType
Implements a date type which can generate instances of java.sql.Date and other JDBC date-related types.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.axiondb.DataType |
|---|
DataType.BinaryRepresentation, DataType.ExactNumeric, DataType.NonFixedPrecision |
| Field Summary |
|---|
| Fields inherited from class org.axiondb.types.TimestampType |
|---|
LOCALE |
| Constructor Summary | |
|---|---|
TimeType()
|
|
| Method Summary | |
|---|---|
boolean |
accepts(Object value)
Returns true iff value is null, a
Number, or a String that can be converted to a Long. |
Object |
convert(Object value)
Returns a java.sql.Date converted from the given value , or throws AxionExceptionif the given value isn't
acceptable. |
int |
getColumnDisplaySize()
Value returned by ResultSetMetaData#getColumnDisplaySizefor this data
type. |
int |
getJdbcType()
Returns the JDBC type codemost closely matching this type. |
int |
getPrecision()
Value returned by ResultSetMetaData#getPrecisionfor this data type. |
static TimeZone |
getTimeZone()
|
DataType |
makeNewInstance()
Creates a new instance of this DataType implementation. |
static long |
normalizeTime(long rawTimeMillis)
|
Object |
read(DataInput in)
Overrides parent implementation to read only milliseconds (as a long) from the input stream, ignoring any nanoseconds written by TimestampType.write(). |
static void |
setTimeZone(String id)
|
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. |
BigDecimal |
toBigDecimal(Object value)
Convert the given non- null value to a
BigDecimal, or throw a AxionException. |
Date |
toDate(Object value)
Convert the given non- null value to a Date,
or throw a SQLException. |
String |
toString()
|
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)
Overrides parent implementation to always write time (in milliseconds) as a long, writing a placeholder zero for the nanosecond field usually written by TimestampType.write(). |
| Methods inherited from class org.axiondb.types.TimestampType |
|---|
compare, getComparator, getPreferredValueClassName |
| Methods inherited from class org.axiondb.types.BaseDataType |
|---|
getLiteralPrefix, getLiteralSuffix, getNullableCode, getPrecisionRadix, getScale, getSearchableCode, isCaseSensitive, isCurrency, isUnsigned, toBigInteger, toBlob, toBoolean, toByte, toByteArray, toClob, toDouble, toFloat, toInt, toLong, toNumber, toShort, toURL |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Comparator |
|---|
equals |
| Constructor Detail |
|---|
public TimeType()
| Method Detail |
|---|
public static TimeZone getTimeZone()
public static long normalizeTime(long rawTimeMillis)
public boolean accepts(Object value)
TimestampTypetrue iff value is null, a
Number, or a String that can be converted to a Long.
accepts in interface DataTypeaccepts in class TimestampTypevalue - non- null valueDataType.accepts(java.lang.Object)
public Object convert(Object value)
throws AxionException
AxionExceptionif the given value isn't
acceptable.
convert in interface DataTypeconvert in class TimestampTypeAxionExceptionpublic int getColumnDisplaySize()
DataTypeResultSetMetaData#getColumnDisplaySizefor this data
type.
getColumnDisplaySize in interface DataTypegetColumnDisplaySize in class TimestampTypeDataType.getColumnDisplaySize()public int getPrecision()
DataTypeResultSetMetaData#getPrecisionfor this data type.
getPrecision in interface DataTypegetPrecision in class TimestampTypeResultSetMetaData.getPrecision(int)public int getJdbcType()
DataTypetype codemost closely matching this type.
getJdbcType in interface DataTypegetJdbcType in class TimestampTypeDataType.getJdbcType()public DataType makeNewInstance()
DataType
makeNewInstance in interface DataTypemakeNewInstance in interface DataTypeFactorymakeNewInstance in class TimestampTypeDataTypeFactory.makeNewInstance()
public Object successor(Object value)
throws IllegalArgumentException
DataType
successor in interface DataTypesuccessor in class TimestampTypeIllegalArgumentExceptionDataType.successor(java.lang.Object)public boolean supportsSuccessor()
DataTypetrue if the DataType.successor(java.lang.Object)method is supported, false
otherwise.
supportsSuccessor in interface DataTypesupportsSuccessor in class TimestampTypeDataType.supportsSuccessor()
public BigDecimal toBigDecimal(Object value)
throws AxionException
DataTypenull value to a
BigDecimal, or throw a AxionException.
toBigDecimal in interface DataTypetoBigDecimal in class TimestampTypeAxionExceptionDataType.toBigDecimal(java.lang.Object)
public Date toDate(Object value)
throws AxionException
DataTypenull value to a Date,
or throw a SQLException.
toDate in interface DataTypetoDate in class TimestampTypeAxionExceptionDataType.toDate(java.lang.Object)public String toString()
toString in class TimestampTypeObject.toString()
public String toString(Object value)
throws AxionException
DataTypenull value to a String, or
throw a AxionException.
toString in interface DataTypetoString in class TimestampTypeAxionExceptionDataType.toString(java.lang.Object)
public Time toTime(Object value)
throws AxionException
DataTypenull value to a Time, or
throw a AxionException.
toTime in interface DataTypetoTime in class TimestampTypeAxionExceptionDataType.toTime(java.lang.Object)
public Timestamp toTimestamp(Object value)
throws AxionException
DataTypenull value to a Timestamp,
or throw a AxionException.
toTimestamp in interface DataTypetoTimestamp in class TimestampTypeAxionExceptionDataType.toTimestamp(java.lang.Object)
public Object read(DataInput in)
throws IOException
TimestampType.
read in interface DataTyperead in class TimestampTypevalue - Time object (typically a java.sql.Time or other
convertible form) to be unpersistedout - DataOutput to supply serialized data
IOException - if error occurs during readDataType.read(java.io.DataInput)
public void write(Object value,
DataOutput out)
throws IOException
TimestampType.
write in interface DataTypewrite in class TimestampTypevalue - time object (typically a java.sql.Time or other
convertible form) to be persistedout - DataOutput to receive serialized data
IOException - if error occurs during writeDataType.write(java.lang.Object, java.io.DataOutput)public static void setTimeZone(String id)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||