|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCrystalValue
com.crystaldecisions.reports.common.value.FormulaValue
com.crystaldecisions.reports.common.value.DateTimeValue
public final class DateTimeValue
Provides methods for converting native Java types to a format understood by the Crystal Reports Formula Language.
All Java user defined functions must return a FormulaValue
object.
Method Summary | |
---|---|
DateTimeValue |
addNumberToDateTime(double nDays)
Adds nDays days to the current date and time. |
FormulaValue |
coerceToDate()
Internal use only. |
FormulaValue |
coerceToDateTime()
Internal use only. |
FormulaValue |
coerceToTime()
Internal use only. |
int |
compareTo(java.lang.Object obj)
Internal use only. |
int |
compareTo(java.lang.Object obj,
java.util.Comparator stringComparator)
Internal use only. |
boolean |
crEquals(DateTimeValue dateTimeValue)
|
boolean |
equals(java.lang.Object obj,
boolean caseInsensitive)
Determines whether the parameter Object is a DateTimeValue object with the same class and value
as this object. |
static DateTimeValue |
From1900Format(double dateTime)
|
static DateTimeValue |
fromCalendar(java.util.Calendar calendar)
Returns a DateTimeValue object that represents the specified calendar parameter. |
static DateTimeValue |
fromDateAndTimeValues(DateValue dateValue,
TimeValue timeValue)
Returns a DateTimeValue object that represents the specified dateValue and timeValue parameters. |
static DateTimeValue |
fromDateValue(DateValue dateValue)
Returns a DateTimeValue object that represents the specified dateValue parameter. |
static DateTimeValue |
fromOleDate(double OleDate)
|
DateValue |
getDateValue()
Gets a DateValue object that represents the date component of this DateTimeValue object. |
int |
getEncodedSize(ValueType type)
|
int |
getEncodedSizeForArchive(ValueType type)
|
java.util.Date |
getJavaDate()
|
static int |
GetMaxEncodedSize()
|
double |
getOleDate()
|
TimeValue |
getTimeValue()
Gets a TimeValue object that represents the time component of this DateTimeValue object. |
ValueType |
getValueType()
Gets a ValueType object that represents this DateTimeValue object. |
int |
hashCode(boolean caseInsensitive)
Returns a hash code for this DateTimeValue object. |
static DateTimeValue |
Load(java.io.DataInput in)
|
static DateTimeValue |
LoadFromArchive(IInputArchive ar)
|
static DateTimeValue |
Normalize(java.lang.Integer crDate,
java.lang.Long timeInNs)
Returns a DateTimeValue object that represents the input in normalized form. |
static DateTimeValue |
now()
Returns a DateTimeValue object that represents the current date and time at the point when the method is called. |
void |
store(ValueType type,
ExtendedDataOutput out)
|
void |
storeToArchive(ValueType type,
IOutputArchive ar)
|
static double |
To1900Format(DateTimeValue dateTime)
Returns a double that represents the time in the 1900 format system (the number of days since Jan 1, 1900). |
java.lang.String |
toString()
Returns a String representation of this DateTimeValue object. |
Methods inherited from class com.crystaldecisions.reports.common.value.FormulaValue |
---|
coerce, coerceToArray, coerceToArray, coerceToBoolean, coerceToBoolean, coerceToCurrency, coerceToCurrency, coerceToDate, coerceToDateTime, coerceToNumber, coerceToNumber, coerceToRange, coerceToRange, coerceToRangeArray, coerceToRangeArray, coerceToString, coerceToString, coerceToTime, getFormulaValueType, Load, LoadFromArchive, makeZeroValue |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public void store(ValueType type, ExtendedDataOutput out) throws java.io.IOException
java.io.IOException
public void storeToArchive(ValueType type, IOutputArchive ar) throws ArchiveException
ArchiveException
public static DateTimeValue Load(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public static DateTimeValue LoadFromArchive(IInputArchive ar) throws ArchiveException
ArchiveException
public int getEncodedSizeForArchive(ValueType type)
public static int GetMaxEncodedSize()
public int getEncodedSize(ValueType type)
public static DateTimeValue Normalize(java.lang.Integer crDate, java.lang.Long timeInNs)
Returns a DateTimeValue
object that represents the input in normalized form.
If the time is greater than a day, then the time is converted into a time that is less than
one day and the number of days in the date is updated accordingly.
crDate
- the unnormalized date. Use null if the value of date should be null.timeInNs
- unnormalized time in nanoseconds. Use null if the value of time the time
should be null.
DateTimeValue
object that represents the input in normalized formpublic static DateTimeValue now()
Returns a DateTimeValue
object that represents the current date and time at the point when the method is called.
DateTimeValue
object that represents the current date and timepublic static DateTimeValue fromDateAndTimeValues(DateValue dateValue, TimeValue timeValue)
Returns a DateTimeValue
object that represents the specified dateValue
and timeValue
parameters.
dateValue
- a DateValue
object that specifies the datetimeValue
- a TimeValue
object that specifies the time
DateTimeValue
object that represents the specified date and time, or null if both the dateValue
and timeValue
parameters are nullpublic static DateTimeValue fromDateValue(DateValue dateValue)
Returns a DateTimeValue
object that represents the specified dateValue
parameter.
dateValue
- a DateValue
object that specifies the date
DateTimeValue
object that represents the specified date, or null if the dateValue
parameter is nullpublic static DateTimeValue fromCalendar(java.util.Calendar calendar)
Returns a DateTimeValue
object that represents the specified calendar
parameter.
calendar
- a Calendar
object that specifies the calendar
DateTimeValue
object that represents the specified calendarpublic static DateTimeValue fromOleDate(double OleDate)
public FormulaValue coerceToDate()
Internal use only.
coerceToDate
in class FormulaValue
public FormulaValue coerceToTime()
Internal use only.
coerceToTime
in class FormulaValue
public FormulaValue coerceToDateTime()
Internal use only.
coerceToDateTime
in class FormulaValue
public double getOleDate()
public DateValue getDateValue()
Gets a DateValue
object that represents the date component of this DateTimeValue
object.
DateValue
object that represents the date component of this DateTimeValue
objectpublic TimeValue getTimeValue()
Gets a TimeValue
object that represents the time component of this DateTimeValue
object.
TimeValue
object that represents the time component of this DateTimeValue
objectpublic ValueType getValueType()
Gets a ValueType
object that represents this DateTimeValue
object.
public int hashCode(boolean caseInsensitive)
Returns a hash code for this DateTimeValue
object.
int
that is a hash code for this DateTimeValue
objectpublic boolean equals(java.lang.Object obj, boolean caseInsensitive)
Determines whether the parameter Object
is a DateTimeValue
object with the same class and value
as this object.
obj
- the Object
to compare this DateTimeValue
object to
true
if obj
has the same class and value is this DateTimeValue
objectpublic int compareTo(java.lang.Object obj, java.util.Comparator stringComparator)
Internal use only.
public int compareTo(java.lang.Object obj)
Internal use only.
compareTo
in interface java.lang.Comparable
public DateTimeValue addNumberToDateTime(double nDays)
Adds nDays
days to the current date and time.
nDays can also represent fractional days (for example, 2 minutes, 4 hours, 3 days and 2 hours and 1 second)
For compatibility with C++, fractional days will be truncated to the nearest second.
If nDays is negative, nDays days is subtracted from the date
nDays
- the number of days (or fractional days) to add (or subtracts)
DateTimeValue
object with the updated date and timepublic java.lang.String toString()
Returns a String
representation of this DateTimeValue
object. The String
is of the form: "dt([date][time])",
where [date] is the String
representation for a DateTimeValue
object and [time] is the String
representation for a TimeValue
object.
String
representation of this DateTimeValue
objectpublic static double To1900Format(DateTimeValue dateTime)
Returns a double
that represents the time in the 1900 format system (the number of days since Jan 1, 1900).
dateTime
- a DateTimeValue
object to be represented in 1900 format system
double
that represents the time in the 1900 format systempublic static DateTimeValue From1900Format(double dateTime)
public java.util.Date getJavaDate()
public boolean crEquals(DateTimeValue dateTimeValue)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |