|
||||||||||
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.YEAR
month
- the month Calendar.MONTH
dayOfMonth
- day of month Calendar.DAY_OF_MONTH
hourOfDay
- hour of day Calendar.HOUR_OF_DAY
minute
- minute Calendar.MINUTE
second
- second Calendar.SECOND
public DateAndTimeCell(int year, int month, int dayOfMonth, int hourOfDay, int minute, int second, int millisecond)
year
- the year Calendar.YEAR
month
- the month Calendar.MONTH
dayOfMonth
- day of month Calendar.DAY_OF_MONTH
hourOfDay
- hour of day Calendar.HOUR_OF_DAY
minute
- minute Calendar.MINUTE
second
- second Calendar.SECOND
millisecond
- 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 availableMethod 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_MONTH
public 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.MILLISECOND
public static final DataCellSerializer<DateAndTimeCell> getCellSerializer()
DataCellSerializer
,
DataCell
public int getYear()
getYear
in interface DateAndTimeValue
Calendar.YEAR
public int getMonth()
getMonth
in interface DateAndTimeValue
Calendar.MONTH
public int getDayOfMonth()
getDayOfMonth
in interface DateAndTimeValue
Calendar.DAY_OF_MONTH
public int getHourOfDay()
getHourOfDay
in interface DateAndTimeValue
Calendar.HOUR_OF_DAY
public int getMinute()
getMinute
in interface DateAndTimeValue
Calendar.MINUTE
public int getSecond()
getSecond
in interface DateAndTimeValue
Calendar.SECOND
public int getMillis()
getMillis
in interface DateAndTimeValue
Calendar.MILLISECOND
public String getStringValue()
getStringValue
in interface StringValue
public static final Calendar getUTCCalendar()
public Calendar getUTCCalendarClone()
getUTCCalendarClone
in interface DateAndTimeValue
Calendar getInternalUTCCalendarMember()
public long getUTCTimeInMillis()
getUTCTimeInMillis
in interface DateAndTimeValue
Calendar.getTimeInMillis()
public boolean hasDate()
hasDate
in interface DateAndTimeValue
public boolean hasTime()
hasTime
in interface DateAndTimeValue
public boolean hasMillis()
hasMillis
in interface DateAndTimeValue
public 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 DataCell
dc
- 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 DataCell
DataCell
Object.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 |