|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.text.Format
com.davisor.data.Type
com.davisor.data.LocaleType
com.davisor.data.FormatType
com.davisor.data.DateFormatType
com.davisor.data.TimestampType
com.davisor.data.RelativeTimestampType
RelativeTimestampType defines a data type that supports timestamp values expressed relative to the given zero timestamp value. The relative timestamp data values are simple double precision floating point values that when multiplied with the type timescale parameter and added to the type zero timestamp parameter result an absolute timestamp value.
DoubleData,
TimestampData,
Serialized Form| Nested Class Summary |
| Nested classes inherited from class java.text.Format |
java.text.Format.Field |
| Field Summary | |
static java.lang.String |
TYPENAME
Type name ("RELATIVESTAMP"). |
| Fields inherited from class com.davisor.data.TimestampType |
DEFAULT |
| Fields inherited from class com.davisor.data.DateFormatType |
GMT, LOCAL, M_style, M_timeZone |
| Fields inherited from class com.davisor.data.FormatType |
M_pattern, M_sample |
| Fields inherited from class com.davisor.data.LocaleType |
DEFAULT_LOCALE, M_locale |
| Fields inherited from class com.davisor.data.Type |
METADATA_GROUP, METADATA_NAME, METADATA_PARENT, METADATA_SUBCHANNELS |
| Constructor Summary | |
|
RelativeTimestampType()
Default constructor. |
|
RelativeTimestampType(RelativeTimestampType rtt)
Copy constructor. |
|
RelativeTimestampType(java.lang.String dataName)
Creates a new default type with no identity. |
|
RelativeTimestampType(java.lang.String dataName,
java.lang.String id,
java.util.Locale locale,
java.lang.String pattern,
java.lang.Object sample,
int style,
java.util.TimeZone timeZone,
long zero,
double scale)
Creates a new relative timestamp type. |
|
RelativeTimestampType(java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.util.Locale locale,
int style,
java.util.TimeZone timeZone,
long zero,
double scale)
Creates a new timestamp type with the specific locale formatting. |
|
RelativeTimestampType(java.lang.String dataName,
java.lang.String id,
java.lang.String format)
Creates a new timestamp type with localized timestamp formatting. |
protected |
RelativeTimestampType(java.lang.String typeName,
java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.util.Locale locale,
java.lang.String pattern,
java.lang.Object sample,
int style,
java.util.TimeZone timeZone,
long zero,
double scale)
Creates a new relative timestamp type. |
| Method Summary | |
byte |
byteValue(byte value)
Converts a byte value to an another byte value. |
byte |
byteValue(java.lang.String value,
java.text.ParsePosition status)
Converts a string to a byte value. |
java.lang.String |
check(java.lang.String value)
Checks and reformats a data string value. |
java.util.Date |
dateValue(double doubleValue)
Computes relative time from the given date value. |
java.util.Date |
dateValue(long longValue)
Computes relative time from the given date value. |
double |
doubleValue(java.util.Date dateValue)
Computes relative time from the given date value. |
double |
doubleValue(double value)
Converts a double value to an another double value. |
double |
doubleValue(long timeValue)
Computes relative time from the given date value. |
double |
doubleValue(java.lang.String value,
java.text.ParsePosition status)
Converts a string to a double value. |
com.davisor.core.Dupable |
dup()
Makes a deep copy of this object. |
boolean |
equals(java.lang.Object o)
Tests if this object is equal with another object. |
float |
floatValue(float value)
Converts a float value to an another float value. |
float |
floatValue(java.lang.String value,
java.text.ParsePosition status)
Converts a string to a float value. |
int |
getSQLCode()
Gets the SQL type code, as defined by java.sql.Types. |
int |
hashCode()
Returns a hash code value for the object. |
int |
intValue(int value)
Converts a integer value to an another int value. |
int |
intValue(java.lang.String value,
java.text.ParsePosition status)
Converts a string to an int value. |
long |
longValue(java.util.Date dateValue)
Computes relative time from the given date value. |
long |
longValue(long value)
Converts a long value to an another long value. |
long |
longValue(java.lang.String value,
java.text.ParsePosition status)
Converts a string to a long value. |
java.lang.Number |
numberValue(java.lang.String value,
java.text.ParsePosition status)
Converts a string to a Number value. |
short |
shortValue(short value)
Converts a short value to an another short value. |
short |
shortValue(java.lang.String value,
java.text.ParsePosition status)
Converts a string to a short value. |
java.lang.String |
stringValue(byte value)
Converts a byte value to a string. |
java.lang.String |
stringValue(double value)
Converts a double value to a string. |
java.lang.String |
stringValue(float value)
Converts a float value to a string. |
java.lang.String |
stringValue(int value)
Converts an int value to a string. |
java.lang.String |
stringValue(long value)
Converts a long value to a string. |
java.lang.String |
stringValue(java.lang.Number value)
Converts a Number value to a string. |
java.lang.String |
stringValue(short value)
Converts a short value to a string. |
DataValue |
toData(java.sql.CallableStatement statement,
int column)
Converts a callable statement variable to a data value. |
DataValue |
toData(java.lang.Object objectValue)
Converts an object to a data value. |
DataValue |
toData(java.sql.ResultSet resultSet,
int column)
Converts a result set column value to a data value. |
DataValue |
toData(java.lang.String stringValue,
java.text.ParsePosition status)
Converts a string to a data value. |
| Methods inherited from class com.davisor.data.TimestampType |
zero |
| Methods inherited from class com.davisor.data.DateFormatType |
createCalendar, createCalendar, createCalendar, createCalendar, createCalendar, createCalendar, createFormatter, dateValue, getFormat, getLast, getStyle, getTimeZone, getValueClass, setFormat, setStyle, setTimeZone, stringValue, strip, toData, toData |
| Methods inherited from class com.davisor.data.FormatType |
clearFormatter, getFormatter, getPattern, getSample, setFormat, setLocale, setPattern, setSample |
| Methods inherited from class com.davisor.data.LocaleType |
getLocale, setLocale |
| Methods inherited from class com.davisor.data.Type |
ceil, check, compare, create, create, create, create, create, dup, floor, format, getCompatibility, getDataName, getId, getID, getMetaData, getMetaData, getSpecs, getSQLName, getSQLName, getTypeName, isNull, parseObject, register, register, setDataName, setId, setID, setMetaData, setMetaData, setSpecs, toString, toXML, xmlEnd, xmlStart |
| Methods inherited from class java.text.Format |
clone, format, formatToCharacterIterator, parseObject |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String TYPENAME
| Constructor Detail |
public RelativeTimestampType()
public RelativeTimestampType(RelativeTimestampType rtt)
public RelativeTimestampType(java.lang.String dataName)
dataName - data name (may be null)
public RelativeTimestampType(java.lang.String dataName,
java.lang.String id,
java.lang.String format)
This is the constructor the SQL type mapper Type.create(Integer,String,String,String) method will call to
create a type that matches given SQL type.
dataName - data nameid - type identityformat - language and country codes, separated by a single
space characters. null or an empty specification
string implies SQL timestamp formatting.DateFormatType.setFormat(java.lang.String)
public RelativeTimestampType(java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.util.Locale locale,
int style,
java.util.TimeZone timeZone,
long zero,
double scale)
dataName - data name (may be null)id - type identity (may be null)metaData - type meta data map (may be null)locale - type locale (may be null)style - time format style, as defined by the DateFormat classtimeZone - date format time zonezero - time offsetscale - time scale
public RelativeTimestampType(java.lang.String dataName,
java.lang.String id,
java.util.Locale locale,
java.lang.String pattern,
java.lang.Object sample,
int style,
java.util.TimeZone timeZone,
long zero,
double scale)
dataName - data name (may be null)id - type identity (may be null)locale - type locale (may be null)pattern - format pattern (may be null)sample - format sample (may be null)style - date format style, as defined by the DateFormat classtimeZone - date format time zonezero - time offsetscale - time scale
protected RelativeTimestampType(java.lang.String typeName,
java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.util.Locale locale,
java.lang.String pattern,
java.lang.Object sample,
int style,
java.util.TimeZone timeZone,
long zero,
double scale)
typeName - type namedataName - data name (may be null)id - type identity (may be null)metaData - type meta data map (may be null)locale - type locale (may be null)pattern - format pattern (may be null)sample - format sample (may be null)style - date format style, as defined by the DateFormat classtimeZone - date format time zonezero - time offsetscale - time scale| Method Detail |
public com.davisor.core.Dupable dup()
dup in interface com.davisor.core.Dupabledup in class TimestampType
public byte byteValue(java.lang.String value,
java.text.ParsePosition status)
throws InvalidDataException
byteValue in interface NumberTypevalue - the string to be convertedstatus - parse status (may be null)
InvalidDataException - if the value cannot
be converted to a byte value.
public double doubleValue(java.lang.String value,
java.text.ParsePosition status)
throws InvalidDataException
doubleValue in interface NumberTypevalue - the string to be convertedstatus - parse status (may be null)
InvalidDataException - if the value cannot
be converted to a double value.
public float floatValue(java.lang.String value,
java.text.ParsePosition status)
throws InvalidDataException
floatValue in interface NumberTypevalue - the string to be convertedstatus - parse status (may be null)
InvalidDataException - if the value cannot
be converted to a float value.
public int intValue(java.lang.String value,
java.text.ParsePosition status)
throws InvalidDataException
intValue in interface NumberTypevalue - the string to be convertedstatus - parse status (may be null)
InvalidDataException - if the value cannot
be converted to a int value.
public long longValue(java.lang.String value,
java.text.ParsePosition status)
throws InvalidDataException
longValue in interface NumberTypevalue - the string to be convertedstatus - parse status (may be null)
InvalidDataException - if the value cannot
be converted to a long value.
public java.lang.Number numberValue(java.lang.String value,
java.text.ParsePosition status)
throws InvalidDataException
numberValue in interface NumberTypevalue - the string to be converted (may be null)status - parse status (may be null)
null
InvalidDataException - if the value cannot
be converted to a long value.
public short shortValue(java.lang.String value,
java.text.ParsePosition status)
throws InvalidDataException
shortValue in interface NumberTypevalue - the string to be convertedstatus - parse status (may be null)
InvalidDataException - if the value cannot
be converted to a short value.public java.lang.String stringValue(byte value)
stringValue in interface NumberTypevalue - the value to be convertedpublic java.lang.String stringValue(double value)
stringValue in interface NumberTypevalue - the value to be convertedpublic java.lang.String stringValue(float value)
stringValue in interface NumberTypevalue - the value to be convertedpublic java.lang.String stringValue(int value)
stringValue in interface NumberTypevalue - the value to be convertedpublic java.lang.String stringValue(long value)
stringValue in interface NumberTypevalue - the value to be convertedpublic java.lang.String stringValue(short value)
stringValue in interface NumberTypevalue - the value to be convertedpublic java.lang.String stringValue(java.lang.Number value)
stringValue in interface NumberTypevalue - the value to be convertedpublic byte byteValue(byte value)
byteValue in interface NumberTypevalue - the value to be convertedpublic double doubleValue(double value)
doubleValue in interface NumberTypevalue - the value to be convertedpublic float floatValue(float value)
floatValue in interface NumberTypevalue - the value to be convertedpublic int intValue(int value)
intValue in interface NumberTypevalue - the value to be convertedpublic long longValue(long value)
longValue in interface NumberTypevalue - the value to be convertedpublic short shortValue(short value)
shortValue in interface NumberTypevalue - the value to be convertedpublic boolean equals(java.lang.Object o)
Relative timestamp types are equal if their super-classes and scale and zero values are.
equals in interface java.util.Comparatorequals in class TimestampTypepublic int hashCode()
hashCode in class DateFormatType
public java.lang.String check(java.lang.String value)
throws InvalidDataException
The default checking procedure is to first parse the data string as a data object, and then turn the resulting object back to a data string. Parsing checks the validity of the data string, while formatting reformats it. Therefore, in addition to validating the input value, the resulting string may also have been changed in some way.
check in class Typevalue - data string value
InvalidDataException - if the value is invalid as a timestampType.check(String[]),
Type.toData(java.lang.String, java.text.ParsePosition),
DataValue.toString()public int getSQLCode()
getSQLCode in class TimestampType
public DataValue toData(java.sql.CallableStatement statement,
int column)
throws InvalidDataException,
java.sql.SQLException
Gets statement double value, and returns a corresponding
DoubleData value.
toData in class TimestampTypestatement - statement holding the data value to be convertedcolumn - SQL column index for the data value to be converted
InvalidDataException - if given object value could not be parsed
java.sql.SQLException - if a SQL error occurstoData(Object),
toData(ResultSet,int),
toData(String,ParsePosition),
DoubleData
public DataValue toData(java.lang.Object objectValue)
throws InvalidDataException
NumberValue, Number, and Date objects are converted directly, other objects are converted first to strings, then to double values.
toData in class DateFormatTypeobjectValue - data object
InvalidDataException - if given object value could not be parsedtoData(CallableStatement,int),
toData(ResultSet,int),
toData(String,ParsePosition),
DoubleData
public DataValue toData(java.lang.String stringValue,
java.text.ParsePosition status)
throws InvalidDataException
RelativeTimestamp type expects the given value to contain a date
or a double value, and returns a corresponding
DoubleData value.
toData in class DateFormatTypestringValue - data stringstatus - parse status (may be null)
InvalidDataException - if given string value could not be parsedtoData(CallableStatement,int),
toData(Object),
toData(ResultSet,int),
DoubleData
public DataValue toData(java.sql.ResultSet resultSet,
int column)
throws InvalidDataException,
java.sql.SQLException
Gets result set column double value, and returns a corresponding
DoubleData value.
toData in class TimestampTyperesultSet - resultSet holding the data value to be convertedcolumn - SQL column index for the data value to be converted
InvalidDataException - if given object value could not be parsed
java.sql.SQLException - if a SQL error occurstoData(CallableStatement,int),
toData(Object),
toData(String,ParsePosition),
DoubleDatapublic java.util.Date dateValue(double doubleValue)
public java.util.Date dateValue(long longValue)
public double doubleValue(java.util.Date dateValue)
public double doubleValue(long timeValue)
public long longValue(java.util.Date dateValue)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||