|
||||||||||
| 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.TimeValue
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.
| Field Summary | |
static int |
hoursPerDay
The number of hours per day is 24. |
static TimeValue |
max
The maximum TimeValue = t(23:59:59.999999999) |
static long |
maxTimeInNs
The maximum time in nanoseconds is one less than the total number of nanoseconds in a day ( nanosecondsPerDay - 1).
|
static TimeValue |
min
The minimum TimeValue = t(00:00:00.000000000) |
static long |
minTimeInNs
The minimum time in nanoseconds is 0. |
static int |
minutesPerHour
The number of minutes per hour is 60. |
static long |
nanosecondsPerDay
The number of nanoseconds per day. |
static long |
nanosecondsPerHour
The number of nanoseconds per hour. |
static int |
nanosecondsPerMillisecond
The number of nanoseconds per millisecond is 1000000. |
static long |
nanosecondsPerMinute
The number of nanoseconds per minute. |
static long |
nanosecondsPerSecond
The number of nanoseconds per second is 1000000000. |
static int |
nullCRTime
A null CRTime value. |
static int |
secondsPerMinute
The number of seconds per minute is 60. |
| Method Summary | |
TimeValue |
addNumberToTime(double nSeconds)
Add nSeconds seconds to the current time. |
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 |
equals(java.lang.Object obj)
Determines whether the parameter Object is a TimeValue object with the same class and value
as this object.
|
static TimeValue |
fromCalendar(java.util.Calendar calendar)
Returns a TimeValue object that represents the time in the specified Calendar object. |
static TimeValue |
fromCRTime(int CRTime)
Internal use only. |
static TimeValue |
fromHMS(int hours,
int minutes,
double seconds)
Returns a TimeValue object that represents the given hours, minutes and seconds parameters.
|
static TimeValue |
fromHMSN(int hours,
int minutes,
int seconds,
long nanoseconds)
Returns a TimeValue object that represents the given hours, minutes, seconds, and nanoseconds parameters.
|
static TimeValue |
fromOleDate(double OleDate)
Internal use only. |
static TimeValue |
fromTimeInNs(long timeInNs)
Returns a TimeValue object that represents the given timeInNS.
|
int |
getCRTime()
Internal use only. |
static int |
getCRTime(TimeValue time)
Internal use only. |
int |
getHours()
Gets the hours component of this TimeValue |
int |
getMinutes()
Gets the minutes component of this TimeValue |
long |
getNanoseconds()
Gets the nanoseconds component of this TimeValue |
double |
getOleDate()
Internal use only. |
double |
getSeconds()
Gets the seconds component of this TimeValue |
long |
getTimeInNs()
Gets the time in nanoseconds from this TimeValue object.
|
ValueType |
getValueType()
Returns the ValueType of this TimeValue object.
|
int |
getWholeSeconds()
Gets the seconds component of this TimeValue |
int |
hashCode()
Returns a hash code for this TimeValue object.
|
static long |
NormalizeTimeInNs(long timeInNs)
Returns a normalized time value represented in nanoseconds. |
static TimeValue |
now()
Returns a TimeValue object that represents the current time when the method is called.
|
static double |
To1900Format(TimeValue time)
Returns a double that represents the time in the 1900 format system (the fraction of the day completed since midnight).
|
java.lang.String |
toString()
Returns a String representation of this TimeValue object. |
| Methods inherited from class com.crystaldecisions.reports.common.value.FormulaValue |
coerce, coerceToArray, coerceToArray, coerceToBoolean, coerceToBoolean, coerceToCurrency, coerceToCurrency, coerceToDate, coerceToDate, coerceToDateTime, coerceToNumber, coerceToNumber, coerceToRange, coerceToRange, coerceToRangeArray, coerceToRangeArray, coerceToString, coerceToString, coerceToTime, getFormulaValueType, makeZeroValue |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int nullCRTime
A null CRTime value.
public static final int hoursPerDay
The number of hours per day is 24.
public static final int minutesPerHour
The number of minutes per hour is 60.
public static final int secondsPerMinute
The number of seconds per minute is 60.
public static final int nanosecondsPerMillisecond
The number of nanoseconds per millisecond is 1000000.
public static final long nanosecondsPerSecond
The number of nanoseconds per second is 1000000000.
public static final long nanosecondsPerMinute
The number of nanoseconds per minute.
public static final long nanosecondsPerHour
The number of nanoseconds per hour.
public static final long nanosecondsPerDay
The number of nanoseconds per day.
public static final long minTimeInNs
The minimum time in nanoseconds is 0.
public static final long maxTimeInNs
The maximum time in nanoseconds is one less than the total number of nanoseconds in a day (nanosecondsPerDay - 1).
public static final TimeValue min
The minimum TimeValue = t(00:00:00.000000000)
public static final TimeValue max
The maximum TimeValue = t(23:59:59.999999999)
| Method Detail |
public static long NormalizeTimeInNs(long timeInNs)
Returns a normalized time value represented in nanoseconds.
timeInNs - the time in nanoseconds
public static TimeValue now()
Returns a TimeValue object that represents the current time when the method is called.
TimeValue object that represents the current time when the method is calledpublic static TimeValue fromTimeInNs(long timeInNs)
Returns a TimeValue object that represents the given timeInNS.
timeInNs - the number of nanoseconds elapsed since midnight
TimeValue object that represents the given timeInNS
java.lang.IllegalArgumentException - if timeInNs is not between minTimeInNs and maxTimeInNspublic static TimeValue fromCRTime(int CRTime)
Internal use only.
public static TimeValue fromOleDate(double OleDate)
Internal use only.
public double getOleDate()
Internal use only.
public static TimeValue fromHMSN(int hours,
int minutes,
int seconds,
long nanoseconds)
Returns a TimeValue object that represents the given hours, minutes, seconds, and nanoseconds parameters.
hours - the number of hours (valid values are between 0 and 23)minutes - the number of minutes (valid values are between 0 and 59)seconds - the number of seconds (valid values are between 0 and 59)nanoseconds - the number of nanoseconds (valid values are between 0 and 999999999)
TimeValue object that represents the given hours, minutes, seconds, and nanoseconds parameters
java.lang.IllegalArgumentException - if any argument is outside the valid range
public static TimeValue fromHMS(int hours,
int minutes,
double seconds)
Returns a TimeValue object that represents the given hours, minutes and seconds parameters.
hours - the number of hours (valid values are between 0 and 23)minutes - the number of minutes (valid values are between 0 and 59)seconds - the number of seconds (valid values are between 0 and 59.999999999)
TimeValue object that represents the given hours, minutes and seconds parameters
java.lang.IllegalArgumentException - if any argument is outside the valid rangepublic static TimeValue fromCalendar(java.util.Calendar calendar)
Returns a TimeValue object that represents the time in the specified Calendar object.
calendar - the Calendar object to represent
TimeValue object that represents the time in the specified Calendar objectpublic long getTimeInNs()
Gets the time in nanoseconds from this TimeValue object.
public static int getCRTime(TimeValue time)
Internal use only.
public int getCRTime()
Internal use only.
public int getHours()
Gets the hours component of this TimeValue object.
int that represents the hours component of this TimeValue objectpublic int getMinutes()
Gets the minutes component of this TimeValue object.
int that represents the minutes component of this TimeValue objectpublic int getWholeSeconds()
Gets the seconds component of this TimeValue object.
int that represents the seconds component of this TimeValue objectpublic double getSeconds()
Gets the seconds component of this TimeValue object.
double that represents the (fractional) seconds component of this TimeValue objectpublic long getNanoseconds()
Gets the nanoseconds component of this TimeValue object.
int that represents the nanoseconds component of this TimeValue objectpublic ValueType getValueType()
Returns the ValueType of this TimeValue object.
public FormulaValue coerceToTime()
Internal use only.
coerceToTime in class FormulaValuepublic FormulaValue coerceToDateTime()
Internal use only.
coerceToDateTime in class FormulaValuepublic boolean equals(java.lang.Object obj)
Determines whether the parameter Object is a TimeValue object with the same class and value
as this object.
obj - the Object to compare this TimeValue object to
true if obj has the same class and value is this TimeValue object
public int compareTo(java.lang.Object obj,
java.util.Comparator stringComparator)
Internal use only.
public int hashCode()
Returns a hash code for this TimeValue object.
public int compareTo(java.lang.Object obj)
Internal use only.
compareTo in interface java.lang.Comparablepublic TimeValue addNumberToTime(double nSeconds)
Add nSeconds seconds to the current time. If nSeconds is negative, nSeconds seconds is
subtracted from the time.
nSeconds - the number of (fractional) seconds to add to the current time
TimeValue object with the updated timepublic java.lang.String toString()
Returns a String representation of this TimeValue object. The String is of the form: "t(hh:mm:ss.nnnnnnnn)", where:
- hh is the hour of the day (00 through 23), as two decimal digits
- mm is the minute within the hour (00 through 59), as two decimal digits
- ss is the second within the minute (00 through 61, as two decimal digits
- nnnnnnnnn is the nanosecond within the second (000000000 through 999999999), as nine decimal digits
String representation of this TimeValue objectpublic static double To1900Format(TimeValue time)
Returns a double that represents the time in the 1900 format system (the fraction of the day completed since midnight).
time - a DateValue object to be represented in 1900 format system
double that represents the time in the 1900 format system
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||