public class TimeType extends TimestampType
DataType.BinaryRepresentation, DataType.ExactNumeric, DataType.NonFixedPrecision
LOCALE
Constructor and Description |
---|
TimeType() |
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(java.lang.Object value)
Returns
true iff value is null , a
Number, or a String that can be converted to a Long. |
java.lang.Object |
convert(java.lang.Object value)
Returns a java.sql.Date converted from the given value , or
throws
AxionException if the given value isn't
acceptable . |
int |
getColumnDisplaySize()
Value returned by
ResultSetMetaData#getColumnDisplaySize for this data
type. |
int |
getJdbcType()
Returns the JDBC
type code most closely matching this type. |
int |
getPrecision()
Value returned by
ResultSetMetaData#getPrecision for this data type. |
static java.util.TimeZone |
getTimeZone() |
DataType |
makeNewInstance()
Creates a new instance of this DataType implementation.
|
static long |
normalizeTime(long rawTimeMillis) |
java.lang.Object |
read(java.io.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(java.lang.String id) |
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)
|
java.sql.Date |
toDate(java.lang.Object value)
Convert the given non-
null value to a Date ,
or throw a SQLException . |
java.lang.String |
toString() |
java.lang.String |
toString(java.lang.Object value)
|
java.sql.Time |
toTime(java.lang.Object value)
|
java.sql.Timestamp |
toTimestamp(java.lang.Object value)
|
void |
write(java.lang.Object value,
java.io.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().
|
compare, getComparator, getPreferredValueClassName
getLiteralPrefix, getLiteralSuffix, getNullableCode, getPrecisionRadix, getScale, getSearchableCode, isCaseSensitive, isCurrency, isUnsigned, toBigInteger, toBlob, toBoolean, toByte, toByteArray, toClob, toDouble, toFloat, toInt, toLong, toNumber, toShort, toURL
public static java.util.TimeZone getTimeZone()
public static long normalizeTime(long rawTimeMillis)
public boolean accepts(java.lang.Object value)
TimestampType
true
iff value is null
, a
Number, or a String that can be converted to a Long.accepts
in interface DataType
accepts
in class TimestampType
value
- non- null
valueDataType.accepts(java.lang.Object)
public java.lang.Object convert(java.lang.Object value) throws AxionException
AxionException
if the given value isn't
acceptable
.convert
in interface DataType
convert
in class TimestampType
AxionException
public int getColumnDisplaySize()
DataType
ResultSetMetaData#getColumnDisplaySize
for this data
type.getColumnDisplaySize
in interface DataType
getColumnDisplaySize
in class TimestampType
DataType.getColumnDisplaySize()
public int getPrecision()
DataType
ResultSetMetaData#getPrecision
for this data type.getPrecision
in interface DataType
getPrecision
in class TimestampType
ResultSetMetaData.getPrecision(int)
public int getJdbcType()
DataType
type code
most closely matching this type.getJdbcType
in interface DataType
getJdbcType
in class TimestampType
DataType.getJdbcType()
public DataType makeNewInstance()
DataType
makeNewInstance
in interface DataType
makeNewInstance
in interface DataTypeFactory
makeNewInstance
in class TimestampType
DataTypeFactory.makeNewInstance()
public java.lang.Object successor(java.lang.Object value) throws java.lang.IllegalArgumentException
DataType
successor
in interface DataType
successor
in class TimestampType
java.lang.IllegalArgumentException
DataType.successor(java.lang.Object)
public boolean supportsSuccessor()
DataType
true
if the DataType.successor(java.lang.Object)
method is supported, false
otherwise.supportsSuccessor
in interface DataType
supportsSuccessor
in class TimestampType
DataType.supportsSuccessor()
public java.math.BigDecimal toBigDecimal(java.lang.Object value) throws AxionException
DataType
toBigDecimal
in interface DataType
toBigDecimal
in class TimestampType
AxionException
DataType.toBigDecimal(java.lang.Object)
public java.sql.Date toDate(java.lang.Object value) throws AxionException
DataType
null
value to a Date
,
or throw a SQLException
.toDate
in interface DataType
toDate
in class TimestampType
AxionException
DataType.toDate(java.lang.Object)
public java.lang.String toString()
toString
in class TimestampType
Object.toString()
public java.lang.String toString(java.lang.Object value) throws AxionException
DataType
toString
in interface DataType
toString
in class TimestampType
AxionException
DataType.toString(java.lang.Object)
public java.sql.Time toTime(java.lang.Object value) throws AxionException
DataType
toTime
in interface DataType
toTime
in class TimestampType
AxionException
DataType.toTime(java.lang.Object)
public java.sql.Timestamp toTimestamp(java.lang.Object value) throws AxionException
DataType
toTimestamp
in interface DataType
toTimestamp
in class TimestampType
AxionException
DataType.toTimestamp(java.lang.Object)
public java.lang.Object read(java.io.DataInput in) throws java.io.IOException
TimestampType
.read
in interface DataType
read
in class TimestampType
value
- Time object (typically a java.sql.Time
or other
convertible form) to be unpersistedout
- DataOutput to supply serialized datajava.io.IOException
- if error occurs during readDataType.read(java.io.DataInput)
public void write(java.lang.Object value, java.io.DataOutput out) throws java.io.IOException
TimestampType
.write
in interface DataType
write
in class TimestampType
value
- time object (typically a java.sql.Time
or other
convertible form) to be persistedout
- DataOutput to receive serialized datajava.io.IOException
- if error occurs during writeDataType.write(java.lang.Object, java.io.DataOutput)
public static void setTimeZone(java.lang.String id)