|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.icu.util.Calendar
com.ibm.icu.util.GregorianCalendar
org.eclipse.birt.chart.util.CDateTime
public class CDateTime
A convenience data type provided to aid in wrapping a datetime value used
with datetime data elements. Refer to
DateTimeDataElement
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.ibm.icu.util.Calendar |
---|
com.ibm.icu.util.Calendar.FormatConfiguration |
Field Summary | |
---|---|
static int |
QUARTER
|
Fields inherited from class com.ibm.icu.util.GregorianCalendar |
---|
AD, BC |
Fields inherited from class com.ibm.icu.util.Calendar |
---|
AM, AM_PM, APRIL, AUGUST, DATE, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DECEMBER, DOW_LOCAL, DST_OFFSET, ERA, EXTENDED_YEAR, FEBRUARY, FRIDAY, HOUR, HOUR_OF_DAY, JANUARY, JULIAN_DAY, JULY, JUNE, MARCH, MAY, MILLISECOND, MILLISECONDS_IN_DAY, MINUTE, MONDAY, MONTH, NOVEMBER, OCTOBER, PM, SATURDAY, SECOND, SEPTEMBER, SUNDAY, THURSDAY, TUESDAY, UNDECIMBER, WEDNESDAY, WEEK_OF_MONTH, WEEK_OF_YEAR, WEEKDAY, WEEKEND, WEEKEND_CEASE, WEEKEND_ONSET, YEAR, YEAR_WOY, ZONE_OFFSET |
Constructor Summary | |
---|---|
CDateTime()
A zero-arg default constructor |
|
CDateTime(com.ibm.icu.util.Calendar c)
A constructor that creates an instance from a given Calendar
value |
|
CDateTime(java.util.Date d)
A constructor that creates an instance from a given java.util.Date value |
|
CDateTime(int year,
int month,
int date)
A constructor that creates an instance for a specified year, month and date |
|
CDateTime(int year,
int month,
int date,
int hour,
int minute)
A constructor that creates an instance for a specified year, month, date, hour and minute |
|
CDateTime(int year,
int month,
int date,
int hour,
int minute,
int second)
A constructor that creates an instance for a specified year, month, date, hour and minute |
|
CDateTime(java.util.Locale aLocale)
Deprecated. use CDateTime(ULocale) instead. |
|
CDateTime(long lTimeInMillis)
A constructor that creates an instance from a given long
value |
|
CDateTime(com.ibm.icu.util.TimeZone tz)
A constructor that creates a default instance for a given timezone |
|
CDateTime(com.ibm.icu.util.TimeZone tz,
java.util.Locale locale)
Deprecated. use CDateTime(TimeZone, ULocale) instead. |
|
CDateTime(com.ibm.icu.util.TimeZone tz,
com.ibm.icu.util.ULocale locale)
A constructor that creates a default instance for a given timezone and locale |
|
CDateTime(com.ibm.icu.util.ULocale locale)
A constructor that creates a default instance for a given locale |
Method Summary | |
---|---|
void |
add(int unit,
int step)
|
boolean |
after(java.lang.Object when)
|
CDateTime |
backward(int iUnit,
int iStep)
A convenient method used in building the ticks for a datetime scale. |
boolean |
before(java.lang.Object when)
|
void |
clearBelow(int iUnit)
Zeroes out all units for this datetime instance below a specified unit. |
static double |
computeDifference(CDateTime cdt1,
CDateTime cdt2,
int iUnit)
Computes the difference between two given datetime values as a fraction for the requested field. |
static double |
computeDifference(CDateTime cdt1,
CDateTime cdt2,
int iUnit,
boolean trimBelow)
Computes the difference between two given datetime values as a fraction for the requested field. |
static int |
computeUnit(CDateTime[] cdta)
Walks through all values in a datetime array and computes the least significant unit for which a difference was noted. |
static int |
computeUnit(DataSetIterator dsi)
Walks through all values in a dataset and computes the least significant unit for which a difference was noted. |
CDateTime |
forward(int iUnit,
int iStep)
A convenient method used in building the ticks for a datetime scale. |
int |
getDay()
Returns the day of the month associated with this instance |
static int |
getDifference(CDateTime cdt1,
CDateTime cdt2)
Returns the most significant datetime unit in which there's a difference or 0 if there is no difference. |
int |
getHour()
Returns the hour (military) associated with this instance |
static int |
getMaximumDaysIn(int iYear)
Returns the number of days for a particular year |
static int |
getMaximumDaysIn(int iMonth,
int iYear)
Returns the number of days for a particular (month,year) combination |
int |
getMinute()
Returns the minute associated with this instance |
int |
getMonth()
Returns the month (0-based) associated with this instance |
static java.lang.String |
getPreferredFormat(int iUnit)
Returns a preferred format specifier for tick labels that represent axis values that will be computed based on the difference between cdt1 and cdt2 |
static int |
getPreferredUnit(CDateTime minDateTime,
CDateTime maxDateTime)
Returns a preferred format specifier for given data-time values will be computed based on the difference between minDateTime and maxDateTime |
int |
getSecond()
Returns the second associated with this instance |
CDateTime |
getUnitStart(int iUnit)
returns a CDateTime, whose value equals to the unit start of the current instance |
int |
getYear()
Returns the year associated with this instance |
static double |
inMillis(int iUnit)
A convenience method provided to return the number of milliseconds available in a given unit |
boolean |
isTimeOnly()
The property timeOnly indicates that this instance of CDateTime only represents a Time value, the Date value will be ignored. |
static CDateTime |
parse(java.lang.String sDateTimeValue)
Parses a value formatted as MM-dd-yyyy HH:mm:ss and attempts to create an instance of this object |
void |
setTimeOnly(boolean timeOnly)
The property timeOnly indicates that this instance of CDateTime only represents a Time value, the Date value will be ignored. |
java.lang.String |
toString()
|
Methods inherited from class com.ibm.icu.util.GregorianCalendar |
---|
getActualMaximum, getActualMinimum, getGregorianChange, getType, hashCode, isEquivalentTo, isLeapYear, roll, setGregorianChange |
Methods inherited from class com.ibm.icu.util.Calendar |
---|
clear, clear, clone, compareTo, compareTo, equals, fieldDifference, get, getAvailableLocales, getAvailableULocales, getDateTimeFormat, getDateTimeFormat, getDateTimePattern, getDayOfWeekType, getDisplayName, getDisplayName, getFieldCount, getFirstDayOfWeek, getGreatestMinimum, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getKeywordValuesForLocale, getLeastMaximum, getLocale, getMaximum, getMinimalDaysInFirstWeek, getMinimum, getTime, getTimeInMillis, getTimeZone, getWeekendTransition, isLenient, isSet, isWeekend, isWeekend, roll, set, set, set, set, setFirstDayOfWeek, setLenient, setMinimalDaysInFirstWeek, setTime, setTimeInMillis, setTimeZone |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int QUARTER
Constructor Detail |
---|
public CDateTime()
public CDateTime(java.util.Date d)
java.util.Date
value
d
- A previously defined Date instancepublic CDateTime(com.ibm.icu.util.Calendar c)
Calendar
value
c
- A previously defined Calendar instancepublic CDateTime(long lTimeInMillis)
long
value
lTimeInMillis
- The time defined in millisecondspublic CDateTime(int year, int month, int date)
year
- The year associated with this instancemonth
- The month index (1-12) of the year (1-based)date
- The day of the month associated with this instancepublic CDateTime(int year, int month, int date, int hour, int minute)
year
- The year associated with this instancemonth
- The month index (1-12) of the year (1-based)date
- The day of the month associated with this instancehour
- The hour (0-23) of the day (military) associated with this
instanceminute
- The minute (0-59) of the hour associated with this instancepublic CDateTime(int year, int month, int date, int hour, int minute, int second)
year
- The year associated with this instancemonth
- The month index (1-12) of the year (1-based)date
- The day of the month associated with this instancehour
- The hour (0-23) of the day (military) associated with this
instanceminute
- The minute (0-59) of the hour associated with this instancesecond
- The second (0-59) of the minute associated with this instancepublic CDateTime(java.util.Locale aLocale)
CDateTime(ULocale)
instead.
locale
- The locale for which the instance is being createdpublic CDateTime(com.ibm.icu.util.ULocale locale)
locale
- The locale for which the instance is being createdpublic CDateTime(com.ibm.icu.util.TimeZone tz)
tz
- The timezone for which the instance is being createdpublic CDateTime(com.ibm.icu.util.TimeZone tz, java.util.Locale locale)
CDateTime(TimeZone, ULocale)
instead.
tz
- The timezone for which the instance is being createdlocale
- The locale for which the instance is being createdpublic CDateTime(com.ibm.icu.util.TimeZone tz, com.ibm.icu.util.ULocale locale)
tz
- The timezone for which the instance is being createdlocale
- The locale for which the instance is being createdMethod Detail |
---|
public CDateTime backward(int iUnit, int iStep)
iUnit
- iStep
-
public CDateTime forward(int iUnit, int iStep)
iUnit
- iStep
-
public final int getYear()
public final int getMonth()
public final int getDay()
public final int getHour()
public final int getMinute()
public final int getSecond()
public static final int getDifference(CDateTime cdt1, CDateTime cdt2)
public static final java.lang.String getPreferredFormat(int iUnit)
iUnit
- The unit for which a preferred pattern is being requested
public static final int getPreferredUnit(CDateTime minDateTime, CDateTime maxDateTime)
minDateTime
- The minimum data-time valuemaxDateTime
- The maximum data-time value
public static final double computeDifference(CDateTime cdt1, CDateTime cdt2, int iUnit)
cdt1
- The first datetime valuecdt2
- The second datetime valueiUnit
- The field with respect to which the difference is being
computed as a fraction
public static final double computeDifference(CDateTime cdt1, CDateTime cdt2, int iUnit, boolean trimBelow)
cdt1
- The first datetime valuecdt2
- The second datetime valueiUnit
- The field with respect to which the difference is being
computed as a fractiontrimBelow
- Specifies if trim the unit below the given unit.
public static final int computeUnit(DataSetIterator dsi)
dsi
- The dataset iterator that facilitates visiting individual
values
public static final int computeUnit(CDateTime[] cdta) throws ChartException
cdta
- A datetime array for which the least significant unit
difference is to be computed
ChartException
public static final int getMaximumDaysIn(int iMonth, int iYear)
iMonth
- The month (0-11) for which the day count is to be retrievediYear
- The year for which the day count is to be retrieved
public static final int getMaximumDaysIn(int iYear)
iYear
- The year for which the day count is to be retrieved
public static final double inMillis(int iUnit)
iUnit
- The unit for which the number of milliseconds are to be
computed
public final void clearBelow(int iUnit)
iUnit
- The unit below which all values are to be zeroed outpublic CDateTime getUnitStart(int iUnit)
iUnit
-
public static CDateTime parse(java.lang.String sDateTimeValue)
sDateTimeValue
- The value to be parsed
public final java.lang.String toString()
toString
in class com.ibm.icu.util.Calendar
public boolean after(java.lang.Object when)
after
in class com.ibm.icu.util.Calendar
public boolean before(java.lang.Object when)
before
in class com.ibm.icu.util.Calendar
public boolean isTimeOnly()
public void setTimeOnly(boolean timeOnly)
timeOnly
- The bTimeOnly to set.public void add(int unit, int step)
add
in class com.ibm.icu.util.Calendar
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |