Package de.uplanet.lucy.server.scripting
Class ChimeraDate
- java.lang.Object
-
- java.util.Date
-
- java.sql.Timestamp
-
- de.uplanet.lucy.server.scripting.ChimeraDate
-
- All Implemented Interfaces:
IDateTimeValueHolder
,IValueHolder<Date>
,Serializable
,Cloneable
,Comparable<Date>
public final class ChimeraDate extends Timestamp implements IDateTimeValueHolder
This class represents a data/time value as both ajava.sql.Timestamp
and as a
.IDateTimeValueHolder
Note: Use this class sparingly, and for scripting purposes only.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ChimeraDate(long p_lTime)
ChimeraDate(Timestamp p_ts)
ChimeraDate(Date p_dt)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChimeraDate
asDate()
Get the current date, i.e.ChimeraDate
asDate(String p_strTimeZone)
Get the current date, i.e.ChimeraDate
asDate(TimeZone p_tz)
Get the current date, i.e.ChimeraDate
asTime()
Get the current time, i.e.String
getCanonicalLexicalRepresentation()
Get the canonical lexical representation of this value according to it's datatype.Object
getRawValue()
Get the raw data that this value holder holds.QName
getType()
The type of data this value holder holds.Date
getValue()
Get the data that this value holder holds.ChimeraDate
getWithoutFractionalSeconds()
Discard the fractional seconds using the UTC time zone.ChimeraDate
getWithoutFractionalSeconds(String p_strTimeZone)
Discard the fractional seconds.ChimeraDate
getWithoutFractionalSeconds(TimeZone p_tz)
Discard the fractional seconds.boolean
hasValue()
Check if this value holder currently holds data or not.-
Methods inherited from class java.sql.Timestamp
after, before, compareTo, compareTo, equals, equals, from, getNanos, getTime, hashCode, setNanos, setTime, toInstant, toLocalDateTime, toString, valueOf, valueOf
-
Methods inherited from class java.util.Date
after, before, clone, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTimezoneOffset, getYear, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setYear, toGMTString, toLocaleString, UTC
-
-
-
-
Method Detail
-
getType
public QName getType()
Description copied from interface:IValueHolder
The type of data this value holder holds.- Specified by:
getType
in interfaceIValueHolder<Date>
- Returns:
IxDatatype.DATETIME
.
-
getValue
public Date getValue()
Description copied from interface:IValueHolder
Get the data that this value holder holds.Implementations MUST ensure that multiple calls to this method will return values that equal each other.
- Specified by:
getValue
in interfaceIValueHolder<Date>
- Returns:
- The data.
-
getRawValue
public Object getRawValue()
Description copied from interface:IValueHolder
Get the raw data that this value holder holds.- Specified by:
getRawValue
in interfaceIValueHolder<Date>
- Returns:
- The raw data.
-
hasValue
public boolean hasValue()
Description copied from interface:IValueHolder
Check if this value holder currently holds data or not.- Specified by:
hasValue
in interfaceIValueHolder<Date>
- Returns:
true
if the data holder holds data, orfalse
otherwise.
-
getCanonicalLexicalRepresentation
public String getCanonicalLexicalRepresentation()
Description copied from interface:IValueHolder
Get the canonical lexical representation of this value according to it's datatype.- Specified by:
getCanonicalLexicalRepresentation
in interfaceIValueHolder<Date>
- Returns:
- The canonical lexical representation of the current date.
- See Also:
Convert.getCanonicalLexicalRepresentationDateTime(Date)
-
getWithoutFractionalSeconds
public ChimeraDate getWithoutFractionalSeconds()
Discard the fractional seconds using the UTC time zone.- Returns:
- The date/time with fractional seconds set to zero.
-
getWithoutFractionalSeconds
public ChimeraDate getWithoutFractionalSeconds(String p_strTimeZone)
Discard the fractional seconds.- Parameters:
p_strTimeZone
- The time zone to be used.- Returns:
- The date/time with fractional seconds set to zero.
-
getWithoutFractionalSeconds
public ChimeraDate getWithoutFractionalSeconds(TimeZone p_tz)
Discard the fractional seconds.- Parameters:
p_tz
- The time zone to be used.- Returns:
- The date/time with fractional seconds set to zero.
-
asDate
public ChimeraDate asDate()
Get the current date, i.e. the instance in time with its UTC time part set to zero.- Returns:
- The current date.
-
asDate
public ChimeraDate asDate(String p_strTimeZone)
Get the current date, i.e. the instance in time with its time part set to zero in the given time zone.- Parameters:
p_strTimeZone
- The time zone to be used.- Returns:
- The current date.
-
asDate
public ChimeraDate asDate(TimeZone p_tz)
Get the current date, i.e. the instance in time with its time part set to zero in the given time zone.- Parameters:
p_tz
- The time zone to be used.- Returns:
- The current date.
-
asTime
public ChimeraDate asTime()
Get the current time, i.e. the instance in time with its date set to zero 1970-01-01 in the UTC time zone.- Returns:
- The current time.
-
-