java.lang.Object | |
↳ | org.jfree.data.time.RegularTimePeriod |
![]() |
An abstract class representing a unit of time. Convenient methods are provided for calculating the next and previous time periods. Conversion methods are defined that return the first and last milliseconds of the time period. The results from these methods are timezone dependent.
This class is immutable, and all subclasses should be immutable also.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DEFAULT_TIME_ZONE |
This field is deprecated.
As of 1.0.11, we discourage the use of this field - use
getDefault() instead.
|
||||||||||
WORKING_CALENDAR | This field is deprecated. This was a bad idea, don't use it! |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a time period that includes the specified millisecond, assuming
the given time zone.
| |||||||||||
Returns a subclass of
RegularTimePeriod that is smaller than
the specified class. | |||||||||||
Returns the date/time that marks the end of the time period.
| |||||||||||
Returns the first millisecond of the time period, evaluated using the
supplied calendar (which incorporates a timezone).
| |||||||||||
This method is deprecated.
As of 1.0.3, you should avoid using this method (it creates
a new Calendar instance every time it is called). You are advised
to call
getFirstMillisecond(Calendar) instead. | |||||||||||
Returns the first millisecond of the time period.
| |||||||||||
This method is deprecated.
As of 1.0.3, you should avoid using this method (it creates
a new Calendar instance every time it is called). You are advised
to call
getLastMillisecond(Calendar) instead. | |||||||||||
Returns the last millisecond of the time period, evaluated using the
supplied calendar (which incorporates a timezone).
| |||||||||||
Returns the last millisecond of the time period.
| |||||||||||
Returns the millisecond closest to the middle of the time period,
evaluated using the supplied calendar (which incorporates a timezone).
| |||||||||||
Returns the millisecond closest to the middle of the time period.
| |||||||||||
This method is deprecated.
As of 1.0.3, you should avoid using this method (it creates
a new Calendar instance every time it is called). You are advised
to call
getMiddleMillisecond(Calendar) instead.
| |||||||||||
Returns a serial index number for the time unit.
| |||||||||||
Returns the date/time that marks the start of the time period.
| |||||||||||
Returns the time period following this one, or
null if some
limit has been reached. | |||||||||||
Recalculates the start date/time and end date/time for this time period
relative to the supplied calendar (which incorporates a time zone).
| |||||||||||
Returns the time period preceding this one, or
null if some
lower limit has been reached. | |||||||||||
Returns a string representation of the time period.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
This field is deprecated.
As of 1.0.11, we discourage the use of this field - use
getDefault()
instead.
The default time zone.
This field is deprecated.
This was a bad idea, don't use it!
A working calendar (recycle to avoid unnecessary object creation).
Creates a time period that includes the specified millisecond, assuming the given time zone.
c | the time period class. |
---|---|
millisecond | the time. |
zone | the time zone. |
Returns a subclass of RegularTimePeriod
that is smaller than
the specified class.
c | a subclass of RegularTimePeriod . |
---|
Returns the date/time that marks the end of the time period. This
method returns a new Date
instance every time it is called.
Returns the first millisecond of the time period, evaluated using the supplied calendar (which incorporates a timezone).
calendar | the calendar (null not permitted). |
---|
NullPointerException | if calendar,/code> is
null. |
---|
This method is deprecated.
As of 1.0.3, you should avoid using this method (it creates
a new Calendar instance every time it is called). You are advised
to call getFirstMillisecond(Calendar)
instead.
Returns the first millisecond of the time period, evaluated within a specific time zone.
zone | the time zone (null not permitted). |
---|
Returns the first millisecond of the time period. This will be
determined relative to the time zone specified in the constructor, or
in the calendar instance passed in the most recent call to the
peg(Calendar)
method.
This method is deprecated.
As of 1.0.3, you should avoid using this method (it creates
a new Calendar instance every time it is called). You are advised
to call getLastMillisecond(Calendar)
instead.
Returns the last millisecond of the time period, evaluated within a specific time zone.
zone | the time zone (null not permitted). |
---|
Returns the last millisecond of the time period, evaluated using the supplied calendar (which incorporates a timezone).
calendar | the calendar (null not permitted). |
---|
Returns the last millisecond of the time period. This will be
determined relative to the time zone specified in the constructor, or
in the calendar instance passed in the most recent call to the
peg(Calendar)
method.
Returns the millisecond closest to the middle of the time period, evaluated using the supplied calendar (which incorporates a timezone).
calendar | the calendar. |
---|
Returns the millisecond closest to the middle of the time period.
This method is deprecated.
As of 1.0.3, you should avoid using this method (it creates
a new Calendar instance every time it is called). You are advised
to call getMiddleMillisecond(Calendar)
instead.
Returns the millisecond closest to the middle of the time period, evaluated within a specific time zone.
zone | the time zone (null not permitted). |
---|
Returns a serial index number for the time unit.
Returns the date/time that marks the start of the time period. This
method returns a new Date
instance every time it is called.
Returns the time period following this one, or null
if some
limit has been reached.
null
).
Recalculates the start date/time and end date/time for this time period relative to the supplied calendar (which incorporates a time zone).
calendar | the calendar (null not permitted). |
---|
Returns the time period preceding this one, or null
if some
lower limit has been reached.
null
).