|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.isi.stella.Stella_Object edu.isi.stella.StandardObject edu.isi.stella.DecodedDateTime
public class DecodedDateTime
A data structure for holding decoded time values with fields for easy access of the components.
Field Summary | |
---|---|
int |
dateTimeDay
|
Keyword |
dateTimeDow
|
int |
dateTimeHour
|
double |
dateTimeMillis
|
int |
dateTimeMinute
|
int |
dateTimeMonth
|
int |
dateTimeSecond
|
int |
dateTimeYear
|
double |
dateTimeZone
|
Constructor Summary | |
---|---|
DecodedDateTime()
|
Method Summary | |
---|---|
static Stella_Object |
accessDecodedDateTimeSlotValue(DecodedDateTime self,
Symbol slotname,
Stella_Object value,
boolean setvalueP)
|
java.lang.String |
decodedDateTimeToIso8601String()
Returns an ISO-8601 string representation of date
The Format is YYYY-MM-DDThh:mm:ss+zz:zz, with the string stopping at
when a null value is first encountered. |
CalendarDate |
encodeCalendarDate()
Returns a calendar date object for timeStructure . |
int |
hashCode_()
Return a hash code for self (can be negative). |
void |
mergeNullFields(DecodedDateTime renamed_Default)
Replace any null valued fields in self with values from renamed_Default . |
void |
mergeSuperiorNullFields(DecodedDateTime renamed_Default)
Replace only null valued fields in self that represent larger
time units than the smallest non-null in self with values from renamed_Default . |
static DecodedDateTime |
newDecodedDateTime()
|
static void |
now(DecodedDateTime parsedValues,
DecodedDateTime defaultValues)
|
static DecodedDateTime |
parseDateTime(java.lang.String dateTimeString,
int start,
int end,
boolean errorOnMismatchP)
Tries very hard to make sense out of the argument dateTimeString and
returns a time structure if successful. |
static DecodedDateTime |
parseDateTimeInTimeZone(java.lang.String dateTimeString,
double timeZone,
int start,
int end,
boolean errorOnMismatchP)
Tries very hard to make sense out of the argument dateTimeString and
returns a time structure if successful. |
static DecodedDateTime |
parseDateTimeRelativeToBase(java.lang.String dateTimeString,
DecodedDateTime baseDateTime,
int start,
int end,
boolean errorOnMismatchP,
boolean mergeNullFieldsP)
Tries very hard to make sense out of the argument dateTimeString and
returns a time structure if successful. |
Surrogate |
primaryType()
Returns the primary type of self . |
void |
setCurrentDate()
Sets the current date into valuesStructure |
void |
setCurrentDateTime()
Sets the current date and time into valuesStructure |
void |
setCurrentTime()
Sets the current time into valuesStructure |
static DecodedDateTime |
stringToDecodedDateTime(java.lang.String input)
Returns a decoded date-time object representing the date and time parsed from the input string. |
static void |
today(DecodedDateTime parsedValues,
DecodedDateTime defaultValues)
|
static void |
tomorrow(DecodedDateTime parsedValues,
DecodedDateTime defaultValues)
|
static void |
yesterday(DecodedDateTime parsedValues,
DecodedDateTime defaultValues)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public double dateTimeMillis
public int dateTimeSecond
public int dateTimeMinute
public int dateTimeHour
public int dateTimeDay
public int dateTimeMonth
public int dateTimeYear
public double dateTimeZone
public Keyword dateTimeDow
Constructor Detail |
---|
public DecodedDateTime()
Method Detail |
---|
public static DecodedDateTime stringToDecodedDateTime(java.lang.String input)
input
string. If no valid parse is found,
null
is returned.
input
-
public static DecodedDateTime parseDateTime(java.lang.String dateTimeString, int start, int end, boolean errorOnMismatchP)
dateTimeString
and
returns a time structure if successful. If not, it returns null
.
If errorOnMismatchP
is true, parse-date-time will signal an error instead of
returning null
.
Default values are 00:00:00 local time on the current date
dateTimeString
- start
- end
- errorOnMismatchP
-
public static DecodedDateTime parseDateTimeInTimeZone(java.lang.String dateTimeString, double timeZone, int start, int end, boolean errorOnMismatchP)
dateTimeString
and
returns a time structure if successful. If not, it returns null
.
If errorOnMismatchP
is true, parse-date-time will signal an error instead of
returning null
.
Default values are 00:00:00 in the given timezone on the current date. If the
given timeZone
value is null
, then the local time zone for the given date
and time will be used as determined by the operating system.
dateTimeString
- timeZone
- start
- end
- errorOnMismatchP
-
public static DecodedDateTime parseDateTimeRelativeToBase(java.lang.String dateTimeString, DecodedDateTime baseDateTime, int start, int end, boolean errorOnMismatchP, boolean mergeNullFieldsP)
dateTimeString
and
returns a time structure if successful. If not, it returns null
.
If errorOnMismatchP
is true, parse-date-time will signal an error instead of
returning null
.
Default values are passed in via baseDateTime
. If the timezone field that
is passed in is NULL, then the local time zone for the parsed date/time will
be used.
If mergeNullFieldsP
is true
, then default values from baseTimeDate
will be merged into missing components. If false
, then they won't be merged
in for null components but can still be used as a basis for interpreatation of
relative time strings like "now" or "yesterday"
dateTimeString
- baseDateTime
- start
- end
- errorOnMismatchP
- mergeNullFieldsP
-
public static DecodedDateTime newDecodedDateTime()
public static void now(DecodedDateTime parsedValues, DecodedDateTime defaultValues)
public static void tomorrow(DecodedDateTime parsedValues, DecodedDateTime defaultValues)
public static void today(DecodedDateTime parsedValues, DecodedDateTime defaultValues)
public static void yesterday(DecodedDateTime parsedValues, DecodedDateTime defaultValues)
public CalendarDate encodeCalendarDate()
timeStructure
.
public void mergeSuperiorNullFields(DecodedDateTime renamed_Default)
self
that represent larger
time units than the smallest non-null in self
with values from renamed_Default
.
The day of the week will be set consistently, if possible.
Example: if self
just has the month being non-null, then only the year
will be filled in from renamed_Default
. If the day and minute were non-null,
then hour, month and year will be filled.
This can be useful when one doesn't want to extend the precision of the answer.
renamed_Default
- public void mergeNullFields(DecodedDateTime renamed_Default)
self
with values from renamed_Default
.
The day of the week will be set consistently, if possible.
renamed_Default
- public java.lang.String decodedDateTimeToIso8601String()
date
The Format is YYYY-MM-DDThh:mm:ss+zz:zz, with the string stopping at
when a null value is first encountered. The time zone will only
be included (if present) if a time value is given.
public void setCurrentDateTime()
valuesStructure
public void setCurrentDate()
valuesStructure
public void setCurrentTime()
valuesStructure
public int hashCode_()
Stella_Object
self
(can be negative). Two objects that are eqlP
are guaranteed to generate the same hash code. Two objects that are not eqlP
do not necessarily generate different hash codes.
hashCode_
in class StandardObject
public static Stella_Object accessDecodedDateTimeSlotValue(DecodedDateTime self, Symbol slotname, Stella_Object value, boolean setvalueP)
public Surrogate primaryType()
Stella_Object
self
.
Gets defined automatically for every non-abstract subclass of OBJECT.
primaryType
in class Stella_Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |