|
JTP API Documentation | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jtp.time.tp.TimePoint | +--jtp.time.tp.CalendarTimePoint
A representation for time points that is grounded in an instance
of GregorianCalendar
.
This class also manages a sorted tree of all of the CalendarTimePoints
which have been returned via getInstance(java.util.Calendar, jtp.time.tp.CalendarTimePoint[])
.
Field Summary | |
static int[] |
calendarFields
|
protected DateFormat |
format
|
protected static TreeMap |
points
|
Method Summary | |
int |
compareTo(Object obj)
|
protected boolean |
equalGranularity(CalendarTimePoint tp)
Returns true if tp is specified at the same level of granularity as this. |
Calendar |
getCalendar()
|
protected CalendarTimePoint |
getCalendarTimePointAfter()
Returns the CalendarTimePoint in the point tree which is immediately after this one. |
protected CalendarTimePoint |
getCalendarTimePointBefore()
Returns the CalendarTimePoint in the point tree which is immediately before this one. |
static CalendarTimePoint |
getInstance(Calendar c,
CalendarTimePoint[] beforeAndAfter)
Returns an instance of CalendarTimePoint which has been properly situated in the point tree. |
static CalendarTimePoint |
getInstance(int year,
int month,
int date,
int hour,
int minute,
int second,
CalendarTimePoint[] beforeAndAfter)
Returns an instance of CalendarTimePoint which has been properly situated in the point tree. |
static CalendarTimePoint |
getInstance(int year,
int month,
int date,
int hour,
int minute,
int second,
int ms,
CalendarTimePoint[] beforeAndAfter)
Returns an instance of CalendarTimePoint which has been properly situated in the point tree. |
static CalendarTimePoint |
getInstance(int year,
int month,
int date,
int hour,
int minute,
int second,
int ms,
TimeZone timezone,
CalendarTimePoint[] beforeAndAfter)
Returns an instance of CalendarTimePoint which has been properly situated in the point tree. |
static CalendarTimePoint |
getInstance(long millis,
CalendarTimePoint[] beforeAndAfter)
Returns an instance of CalendarTimePoint which has been properly situated in the point tree. |
protected int |
getLargestUnsetField()
Returns the CalendarTimePoint's largest unset field. |
protected int |
getSmallestSetField()
Returns the CalendarTimePoint's smallest field which is set, and which the next smallest field is unset. |
static void |
reset()
|
String |
toString()
|
Methods inherited from class jtp.time.tp.TimePoint |
getID, getNode, setNode |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static TreeMap points
protected DateFormat format
public static final int[] calendarFields
Method Detail |
public Calendar getCalendar()
public static void reset()
public static CalendarTimePoint getInstance(Calendar c, CalendarTimePoint[] beforeAndAfter)
c
- a Calendar which the returned time point should be grounded inbeforeAndAfter
- a two-element array which will be filled in with the CalendarTimePoints in the point tree immediately before and after the returned CalendarTimePoint if the CalendarTimePoint returned is newly createdpublic static CalendarTimePoint getInstance(int year, int month, int date, int hour, int minute, int second, CalendarTimePoint[] beforeAndAfter)
See getInstance(int, int, int, int, int, int, int, CalendarTimePoint[])
for a description of parameters.
public static CalendarTimePoint getInstance(int year, int month, int date, int hour, int minute, int second, int ms, CalendarTimePoint[] beforeAndAfter)
int fields are used to initialize a Calendar
object
year
- the year represented by this pointmonth
- the month represented by this point. First month of the year (January) is 0date
- the day of the month represented by this point. First day of the month is 1hour
- the hour of the day represented by this point. First hour of the day is 0 and last hour is 23minute
- the minute of the hour represented by this point. First minute is 0 and last minute is 59second
- the second of the minute represented by this point. First second is 0 and last second is 59ms
- the millisecond of the second represented by this point. First millisecond is 0 and last millisecond is 999beforeAndAfter
- a two-element array which will be filled in with the CalendarTimePoints in the point tree immediately before and after the returned CalendarTimePoint if the CalendarTimePoint returned is newly createdpublic static CalendarTimePoint getInstance(int year, int month, int date, int hour, int minute, int second, int ms, TimeZone timezone, CalendarTimePoint[] beforeAndAfter)
int fields are used to initialize a Calendar
object
year
- the year represented by this pointmonth
- the month represented by this point. First month of the year (January) is 0date
- the day of the month represented by this point. First day of the month is 1hour
- the hour of the day represented by this point. First hour of the day is 0 and last hour is 23minute
- the minute of the hour represented by this point. First minute is 0 and last minute is 59second
- the second of the minute represented by this point. First second is 0 and last second is 59ms
- the millisecond of the second represented by this point. First millisecond is 0 and last millisecond is 999timezone
- the TimeZone
of the date represented by this point.beforeAndAfter
- a two-element array which will be filled in with the CalendarTimePoints in the point tree immediately before and after the returned CalendarTimePoint if the CalendarTimePoint returned is newly createdpublic static CalendarTimePoint getInstance(long millis, CalendarTimePoint[] beforeAndAfter)
Calendar
on
which the point is
based has millisecond granularity.
millis
- with Calendar.setTime(java.util.Date)
, used to set time of Calendar objectbeforeAndAfter
- a two-element array which will be filled in with the CalendarTimePoints in the point tree immediately before and after the returned CalendarTimePoint if the CalendarTimePoint returned is newly createdprotected boolean equalGranularity(CalendarTimePoint tp)
Only checks the Calendar fields Calendar.ERA
,
Calendar.YEAR
, Calendar.MONTH
,
Calendar.DATE
, Calendar.HOUR_OF_DAY
,
Calendar.MINUTE
, Calendar.SECOND
,
and Calendar.MILLISECOND
.
protected CalendarTimePoint getCalendarTimePointBefore()
protected CalendarTimePoint getCalendarTimePointAfter()
protected int getLargestUnsetField()
protected int getSmallestSetField()
public int compareTo(Object obj)
compareTo
in interface Comparable
public String toString()
toString
in class TimePoint
|
JTP API Documentation | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |