|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.knime.core.data.DataCell
org.knime.core.data.date.DateAndTimeCell
public class DateAndTimeCell
Cell storing a time and/or date. Time is represented by a Calendar
set to UTC time. No support for time zones. A DateAndTimeCell can be
created by passing only the date fields (year, month, day), only the time
fields (hour, minute, seconds, and milliseconds).
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.knime.core.data.StringValue |
|---|
StringValue.StringUtilityFactory |
| Nested classes/interfaces inherited from interface org.knime.core.data.DataValue |
|---|
DataValue.UtilityFactory |
| Field Summary | |
|---|---|
static DataType |
TYPE
DataType of this cell. |
static TimeZone |
UTC_TIMEZONE
The UTC time zone used to represent the time. |
| Fields inherited from interface org.knime.core.data.date.DateAndTimeValue |
|---|
UTILITY |
| Fields inherited from interface org.knime.core.data.StringValue |
|---|
UTILITY |
| Constructor Summary | |
|---|---|
DateAndTimeCell(int year,
int month,
int dayOfMonth)
A date timestamp without time. |
|
DateAndTimeCell(int hourOfDay,
int minute,
int second,
int milliseconds)
A timestamp without date. |
|
DateAndTimeCell(int year,
int month,
int dayOfMonth,
int hourOfDay,
int minute,
int second)
|
|
DateAndTimeCell(int year,
int month,
int dayOfMonth,
int hourOfDay,
int minute,
int second,
int millisecond)
|
|
DateAndTimeCell(long utcTime,
boolean hasDate,
boolean hasTime,
boolean hasMillis)
For internal use only! |
|
| Method Summary | |
|---|---|
protected boolean |
equalsDataCell(DataCell dc)
Derived classes implement their specific equals function here. |
static DataCellSerializer<DateAndTimeCell> |
getCellSerializer()
|
int |
getDayOfMonth()
|
int |
getHourOfDay()
|
(package private) Calendar |
getInternalUTCCalendarMember()
Convenience method to access member UTC Calendar (for faster comparisons/equal tests). |
int |
getMillis()
|
int |
getMinute()
|
int |
getMonth()
|
static Class<? extends DataValue> |
getPreferredValueClass()
Static method indicating preferred value class as required by DataCell API. |
int |
getSecond()
|
String |
getStringValue()
|
static Calendar |
getUTCCalendar()
|
Calendar |
getUTCCalendarClone()
|
long |
getUTCTimeInMillis()
|
int |
getYear()
|
boolean |
hasDate()
|
int |
hashCode()
This method must be implemented in order to ensure that two equal DataCell objects return the same hash code. |
boolean |
hasMillis()
|
boolean |
hasTime()
|
static DateAndTimeCell |
load(ConfigRO config)
Load a data cell that was previously written with the save(ConfigWO) method. |
static void |
resetDateFields(Calendar cal)
|
static void |
resetTimeFields(Calendar cal)
|
void |
save(ConfigWO config)
Save this cell to the argument config. |
String |
toString()
Returns the String representation of this cell's value. |
| Methods inherited from class org.knime.core.data.DataCell |
|---|
equals, getType, isMissing |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final TimeZone UTC_TIMEZONE
public static final DataType TYPE
DataType of this cell.
| Constructor Detail |
|---|
public DateAndTimeCell(int year,
int month,
int dayOfMonth)
year - the yearmonth - the month (1-12)dayOfMonth - the day of the month (1-31)
public DateAndTimeCell(int hourOfDay,
int minute,
int second,
int milliseconds)
hourOfDay - the hour of the dayminute - the minutesecond - the secondmilliseconds - the milliseconds (or <0 if they should not be set)
public DateAndTimeCell(int year,
int month,
int dayOfMonth,
int hourOfDay,
int minute,
int second)
year - the year Calendar.YEARmonth - the month Calendar.MONTHdayOfMonth - day of month Calendar.DAY_OF_MONTHhourOfDay - hour of day Calendar.HOUR_OF_DAYminute - minute Calendar.MINUTEsecond - second Calendar.SECOND
public DateAndTimeCell(int year,
int month,
int dayOfMonth,
int hourOfDay,
int minute,
int second,
int millisecond)
year - the year Calendar.YEARmonth - the month Calendar.MONTHdayOfMonth - day of month Calendar.DAY_OF_MONTHhourOfDay - hour of day Calendar.HOUR_OF_DAYminute - minute Calendar.MINUTEsecond - second Calendar.SECONDmillisecond - milliseconds Calendar.MILLISECOND
(or <0 if they should not be set)
public DateAndTimeCell(long utcTime,
boolean hasDate,
boolean hasTime,
boolean hasMillis)
utcTime - milliseconds in UTC timehasDate - true if the date (year, month ,day) is availablehasTime - true if the time is available (hour, minute, second)hasMillis - true if milliseconds are available| Method Detail |
|---|
public static final Class<? extends DataValue> getPreferredValueClass()
public static void resetDateFields(Calendar cal)
cal - the calendar containing time fields and for which the date
fields should be reset
Calendar.YEAR, Calendar.MONTH,
Calendar.DAY_OF_MONTHpublic static void resetTimeFields(Calendar cal)
cal - the calendar containing date fields and for which the time
fields should be reset
Calendar.HOUR, Calendar.HOUR_OF_DAY,
Calendar.MINUTE, Calendar.SECOND,
Calendar.MILLISECONDpublic static final DataCellSerializer<DateAndTimeCell> getCellSerializer()
DataCellSerializer,
DataCellpublic int getYear()
getYear in interface DateAndTimeValueCalendar.YEARpublic int getMonth()
getMonth in interface DateAndTimeValueCalendar.MONTHpublic int getDayOfMonth()
getDayOfMonth in interface DateAndTimeValueCalendar.DAY_OF_MONTHpublic int getHourOfDay()
getHourOfDay in interface DateAndTimeValueCalendar.HOUR_OF_DAYpublic int getMinute()
getMinute in interface DateAndTimeValueCalendar.MINUTEpublic int getSecond()
getSecond in interface DateAndTimeValueCalendar.SECONDpublic int getMillis()
getMillis in interface DateAndTimeValueCalendar.MILLISECONDpublic String getStringValue()
getStringValue in interface StringValuepublic static final Calendar getUTCCalendar()
public Calendar getUTCCalendarClone()
getUTCCalendarClone in interface DateAndTimeValueCalendar getInternalUTCCalendarMember()
public long getUTCTimeInMillis()
getUTCTimeInMillis in interface DateAndTimeValueCalendar.getTimeInMillis()public boolean hasDate()
hasDate in interface DateAndTimeValuepublic boolean hasTime()
hasTime in interface DateAndTimeValuepublic boolean hasMillis()
hasMillis in interface DateAndTimeValuepublic void save(ConfigWO config)
config - To save to.load(ConfigRO)
public static DateAndTimeCell load(ConfigRO config)
throws InvalidSettingsException
save(ConfigWO) method.
config - To load from.
InvalidSettingsException - If the config is incomplete or invalid.protected boolean equalsDataCell(DataCell dc)
null or a missing value,
to be of the same class like this.
equalsDataCell in class DataCelldc - the cell to compare this to
true if this is equal to the argument,
false if notpublic int hashCode()
DataCell objects return the same hash code.
hashCode in class DataCellDataCellObject.hashCode(),
DataCell.equals(java.lang.Object)public String toString()
toString in class DataCell
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||