org.axiondb.types

Class DateType

public class DateType extends TimestampType

Implements a date type which can generate instances of java.sql.Date and other JDBC date-related types.

Version: $Revision: 1.7 $

Author: Jonathan Giron Ahimanikya Satapathy

Method Summary
booleanaccepts(Object value)
Objectconvert(Object value)
Returns a java.sql.Date converted from the given value , or throws IllegalArgumentExceptionif the given value isn't acceptable.
intgetColumnDisplaySize()
intgetJdbcType()
intgetPrecision()
DataTypemakeNewInstance()
static longnormalizeToUTCZeroHour(long rawTimeMillis)
Objectread(DataInput in)
Overrides parent implementation to read only milliseconds (as a long) from the input stream, ignoring any nanoseconds written by TimestampType.write().
static voidsetTimeZone(String id)
Objectsuccessor(Object value)
booleansupportsSuccessor()
BigDecimaltoBigDecimal(Object value)
DatetoDate(Object value)
StringtoString()
StringtoString(Object value)
TimetoTime(Object value)
TimestamptoTimestamp(Object value)
voidwrite(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().

Method Detail

accepts

public boolean accepts(Object value)

convert

public Object convert(Object value)
Returns a java.sql.Date converted from the given value , or throws IllegalArgumentExceptionif the given value isn't acceptable.

getColumnDisplaySize

public int getColumnDisplaySize()

See Also: getColumnDisplaySize

getJdbcType

public int getJdbcType()

See Also: getJdbcType

getPrecision

public int getPrecision()

makeNewInstance

public DataType makeNewInstance()

See Also: makeNewInstance

normalizeToUTCZeroHour

public static long normalizeToUTCZeroHour(long rawTimeMillis)

read

public 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(). We read TimeType data assuming that they are in the same form as that of TimestampType data in order to preserve backwards compatibility, as java.sql.Time was originally mapped to TimestampType.

Parameters: value Date object (typically a java.sql.Date or other convertible form) to be unpersisted out DataOutput to supply serialized data

Throws: IOException if error occurs during read

See Also: DataType

setTimeZone

public static void setTimeZone(String id)

successor

public Object successor(Object value)

See Also: DataType

supportsSuccessor

public boolean supportsSuccessor()

See Also: supportsSuccessor

toBigDecimal

public BigDecimal toBigDecimal(Object value)

See Also: DataType

toDate

public Date toDate(Object value)

See Also: DataType

toString

public String toString()

See Also: java.lang.Object#toString()

toString

public String toString(Object value)

See Also: DataType

toTime

public Time toTime(Object value)

See Also: DataType

toTimestamp

public Timestamp toTimestamp(Object value)

See Also: DataType

write

public 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().

Parameters: value Date object (typically a java.sql.Date or other convertible form) to be persisted out DataOutput to receive serialized data

Throws: IOException if error occurs during write

See Also: DataType