|
|||||||||
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.Quantity edu.isi.stella.DateTimeObject edu.isi.stella.CalendarDate
public class CalendarDate
Representation of Date and Time with the date represented as a modified Julian day (starting at midnight instead of noon) and the time as the offset in milliseconds from midnight, UTC
Field Summary | |
---|---|
int |
modifiedJulianDay
|
int |
timeMillis
|
Constructor Summary | |
---|---|
CalendarDate()
|
Method Summary | |
---|---|
static Stella_Object |
accessCalendarDateSlotValue(CalendarDate self,
Symbol slotname,
Stella_Object value,
boolean setvalueP)
|
static void |
addDateSubstitution(CalendarDate date,
KeyValueList substitutionList)
Fill in substitutionList with template variable substitions
for the names YEAR, MONTH, MON, DAY, HOUR, MINUTE, SECOND, TIMEZONE,
DAY-OF-WEEK, DOW with their values for date . |
java.lang.String |
calendarDateToDateString(double timezone,
boolean numericMonthP)
Returns the date part of the string representation of date
adjusted for timezone . |
java.lang.String |
calendarDateToIso8601String(double timezone,
boolean includeTimezoneP)
Returns an ISO-8601 string representation of date adjusted for timezone . |
long |
calendarDateToNativeDateTime()
|
java.lang.String |
calendarDateToString(double timezone,
boolean numericMonthP,
boolean includeTimezoneP)
Returns a string representation of date adjusted for timezone . |
java.lang.String |
calendarDateToTimeString(double timezone,
boolean includeTimezoneP,
boolean includeMillisP,
boolean padHoursP)
Returns the time part of the string representation of date
adjusted for timezone . |
Quantity |
coerceTo(Stella_Object y)
|
DecodedDateTime |
decodeCalendarDate(double timezone)
Returns a decoded time object for date interpreted in timezone
timezone is the number of hours added to UTC to get local time. |
int |
getCalendarDate(double timezone,
java.lang.Object[] MV_returnarray)
Returns multiple values of year, month, day and day of week for date
in timezone . |
int |
getTime(double timezone,
java.lang.Object[] MV_returnarray)
Returns multiple values of hours, minutes, seconds, milliseconds for the calendar date date in timezone . |
boolean |
greaterEqualP(Stella_Object t2)
|
boolean |
greaterP(Stella_Object t2)
|
int |
hashCode_()
Return a hash code for self (can be negative). |
boolean |
lessEqualP(Stella_Object t2)
|
boolean |
lessP(Stella_Object t2)
|
static CalendarDate |
makeCalendarDate(int day,
int time)
|
static CalendarDate |
makeCurrentDateTime()
Create a calendar date with current time and date. |
static CalendarDate |
makeDateTime(int year,
int month,
int day,
int hour,
int minute,
int second,
int millis,
double timezone)
Create a calendar date with the specified components. |
static CalendarDate |
nativeDateTimeToCalendarDate(long date)
|
static CalendarDate |
newCalendarDate()
|
boolean |
objectEqlP(Stella_Object t2)
|
Surrogate |
primaryType()
Returns the primary type of self . |
void |
printCalendarDate(java.io.PrintStream stream)
|
void |
printObject(java.io.PrintStream stream)
|
static CalendarDate |
stringToCalendarDate(java.lang.String input)
Returns a calendar date object representing the date and time parsed from the input string. |
static CalendarDate |
stringToCalendarDateWithDefault(java.lang.String inputDate,
DecodedDateTime defaultDate)
Returns a calendar date object representing the date and time parsed from the inputDate string. |
Methods inherited from class edu.isi.stella.DateTimeObject |
---|
timeAdd, timeSubtract |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int modifiedJulianDay
public int timeMillis
Constructor Detail |
---|
public CalendarDate()
Method Detail |
---|
public static CalendarDate stringToCalendarDateWithDefault(java.lang.String inputDate, DecodedDateTime defaultDate)
inputDate
string. Default values for missing fields and
the interpretation of relative references come from defaultDate
. If the
defaultDate
is null
, the current date will be used. If a null set of
defaults is desired, use $NULL_DECODED_DATE_TIME$
.
If no valid parse is found, null
is returned.
inputDate
- defaultDate
-
public static CalendarDate stringToCalendarDate(java.lang.String input)
input
string. If no valid parse is found,
null
is returned.
input
-
public static CalendarDate makeCalendarDate(int day, int time)
public static CalendarDate makeCurrentDateTime()
public static CalendarDate makeDateTime(int year, int month, int day, int hour, int minute, int second, int millis, double timezone)
year
must be
the complete year (i.e., a year of 98 is 98 A.D in the 1st century).
timezone
is a real number in the range -12.0 to +14.0 where UTC is zone 0.0; The number
is the number of hours to add to UTC to arrive at local time.
year
- month
- day
- hour
- minute
- second
- millis
- timezone
-
public static CalendarDate nativeDateTimeToCalendarDate(long date)
public static CalendarDate newCalendarDate()
public static void addDateSubstitution(CalendarDate date, KeyValueList substitutionList)
substitutionList
with template variable substitions
for the names YEAR, MONTH, MON, DAY, HOUR, MINUTE, SECOND, TIMEZONE,
DAY-OF-WEEK, DOW with their values for date
. Also, pre-formatted
DATE, TIME and ISO8601 variables are set.
TIMEZONE is in the format "{+|-}hhmm". MONTH is the full English month name and MON is the numeric month. DAY-OF-WEEK is an English string and DOW is the first three letters. Minutes and seconds are zero-padded.
These substitutions can be used with substituteTemplateVariablesInString
date
- substitutionList
- public boolean greaterEqualP(Stella_Object t2)
greaterEqualP
in class Quantity
public boolean lessEqualP(Stella_Object t2)
lessEqualP
in class Quantity
public boolean greaterP(Stella_Object t2)
greaterP
in class Quantity
public boolean lessP(Stella_Object t2)
lessP
in class Quantity
public boolean objectEqlP(Stella_Object t2)
objectEqlP
in class Stella_Object
public DecodedDateTime decodeCalendarDate(double timezone)
date
interpreted in timezone
timezone
is the number of hours added to UTC to get local time. It is
in the range -12.0 to +14.0 where UTC is zone 0.0
timezone
-
public int getTime(double timezone, java.lang.Object[] MV_returnarray)
date
in timezone
. timezone
is the number of hours added to UTC
to get local time. It is in the range -12.0 to +14.0 where UTC is zone 0.0
timezone
- MV_returnarray
-
public int getCalendarDate(double timezone, java.lang.Object[] MV_returnarray)
date
in timezone
. timezone
is the number of hours added to UTC to get local time. It
is in the range -12.0 to +14.0 where UTC is zone 0.0
timezone
- MV_returnarray
-
public void printCalendarDate(java.io.PrintStream stream)
public long calendarDateToNativeDateTime()
public java.lang.String calendarDateToIso8601String(double timezone, boolean includeTimezoneP)
date
adjusted for timezone
.
The Format is YYYY-MM-DDThh:mm:ss z:zz. The timezone as an offset
hh:mm is included if includeTimezoneP
is true
.
Recommended values for the flag is true
.
timezone
- includeTimezoneP
-
public java.lang.String calendarDateToString(double timezone, boolean numericMonthP, boolean includeTimezoneP)
date
adjusted for timezone
.
The Format is YYYY-MMM-DD hh:mm:ss z.z, where MMM is a three letter
English abbreviation of the month if numericMonthP
is false
and a two
digit numeric value if numericMonthP
is true
. The timezone as a
float offset z.z is included if includeTimezoneP
is true
.
Recommended values for the flags are false
and true
respectively.
timezone
- numericMonthP
- includeTimezoneP
-
public java.lang.String calendarDateToTimeString(double timezone, boolean includeTimezoneP, boolean includeMillisP, boolean padHoursP)
date
adjusted for timezone
. The timezone is included in the string if
includeTimezoneP
is true
. The value true
is recommended.
Milliseconds will be included if includeMillisP
is true
.
Hours will be zero-padded to length 2 if padHoursP
is true
.
timezone
- includeTimezoneP
- includeMillisP
- padHoursP
-
public java.lang.String calendarDateToDateString(double timezone, boolean numericMonthP)
date
adjusted for timezone
. Format is YYYY-MMM-DD, where MMM is a three letter
English abbreviation of the month if numericMonthP
is false
and a two
digit numeric value if numericMonthP
is true
. The value false
is
recommended.
timezone
- numericMonthP
-
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 Stella_Object
public Quantity coerceTo(Stella_Object y)
coerceTo
in class Quantity
public void printObject(java.io.PrintStream stream)
printObject
in class Stella_Object
public static Stella_Object accessCalendarDateSlotValue(CalendarDate 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 |