|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jrefinery.data.TimePeriod | +--com.jrefinery.data.FixedMillisecond
Wrapper for a java.util.Date object that allows it to be used as a TimePeriod.
This class is immutable, which is a requirement for all TimePeriod subclasses.
Fields inherited from class com.jrefinery.data.TimePeriod |
DEFAULT_TIME_ZONE, WORKING_CALENDAR |
Fields inherited from interface com.jrefinery.date.MonthConstants |
APRIL, AUGUST, DECEMBER, FEBRUARY, JANUARY, JULY, JUNE, MARCH, MAY, NOVEMBER, OCTOBER, SEPTEMBER |
Constructor Summary | |
FixedMillisecond()
Constructs a millisecond based on the current system time. |
|
FixedMillisecond(java.util.Date time)
Constructs a millisecond. |
|
FixedMillisecond(long millisecond)
Constructs a millisecond. |
Method Summary | |
int |
compareTo(java.lang.Object o1)
Returns an integer indicating the order of this Millisecond object relative to the specified object: negative == before, zero == same, positive == after. |
long |
getEnd()
Returns the last millisecond of the time period. |
long |
getEnd(java.util.Calendar calendar)
Returns the last millisecond of the time period. |
long |
getMiddle()
Returns the millisecond closest to the middle of the time period. |
long |
getMiddle(java.util.Calendar calendar)
Returns the millisecond closest to the middle of the time period. |
long |
getSerialIndex()
Returns a serial index number for the millisecond. |
long |
getStart()
Returns the first millisecond of the time period. |
long |
getStart(java.util.Calendar calendar)
Returns the first millisecond of the time period. |
java.util.Date |
getTime()
Returns the date/time. |
TimePeriod |
next()
Returns the millisecond following this one. |
TimePeriod |
previous()
Returns the millisecond preceding this one. |
Methods inherited from class com.jrefinery.data.TimePeriod |
getEnd, getMiddle, getStart |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FixedMillisecond()
public FixedMillisecond(long millisecond)
millisecond
- the millisecond (same encoding as java.util.Date).public FixedMillisecond(java.util.Date time)
time
- the time.Method Detail |
public java.util.Date getTime()
public TimePeriod previous()
previous
in class TimePeriod
public TimePeriod next()
next
in class TimePeriod
public int compareTo(java.lang.Object o1)
o1
- the object to compare.public long getStart()
getStart
in class TimePeriod
public long getStart(java.util.Calendar calendar)
getStart
in class TimePeriod
calendar
- the calendar.public long getEnd()
getEnd
in class TimePeriod
public long getEnd(java.util.Calendar calendar)
getEnd
in class TimePeriod
calendar
- the calendar.public long getMiddle()
getMiddle
in class TimePeriod
public long getMiddle(java.util.Calendar calendar)
getMiddle
in class TimePeriod
calendar
- the calendar.public long getSerialIndex()
getSerialIndex
in class TimePeriod
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |