Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.jfree.data.time.RegularTimePeriod
public abstract class RegularTimePeriod
extends java.lang.Object
implements TimePeriod, Comparable, MonthConstants
Field Summary | |
static TimeZone |
|
static Calendar |
|
Method Summary | |
static RegularTimePeriod |
|
static Class |
|
Date |
|
abstract long |
|
abstract long |
|
long |
|
abstract long |
|
abstract long |
|
long |
|
long |
|
long |
|
long |
|
abstract long |
|
Date |
|
abstract RegularTimePeriod |
|
abstract void |
|
abstract RegularTimePeriod |
|
String |
|
public static final Calendar WORKING_CALENDAR
Deprecated. This was a bad idea, don't use it!
A working calendar (recycle to avoid unnecessary object creation).
public static RegularTimePeriod createInstance(Class c, Date millisecond, TimeZone zone)
Creates a time period that includes the specified millisecond, assuming the given time zone.
- Parameters:
c
- the time period class.millisecond
- the time.zone
- the time zone.
- Returns:
- The time period.
public static Class downsize(Class c)
Returns a subclass ofRegularTimePeriod
that is smaller than the specified class.
- Parameters:
c
- a subclass ofRegularTimePeriod
.
- Returns:
- A class.
public Date getEnd()
Returns the date/time that marks the end of the time period. This method returns a newDate
instance every time it is called.
- Specified by:
- getEnd in interface TimePeriod
- Returns:
- The end date/time.
- See Also:
getLastMillisecond()
public abstract long getFirstMillisecond()
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 thepeg(Calendar)
method.
- Returns:
- The first millisecond of the time period.
- See Also:
getLastMillisecond()
public abstract long getFirstMillisecond(Calendar calendar)
Returns the first millisecond of the time period, evaluated using the supplied calendar (which incorporates a timezone).
- Parameters:
calendar
- the calendar (null
not permitted).
- Returns:
- The first millisecond of the time period.
- See Also:
getLastMillisecond(Calendar)
public long getFirstMillisecond(TimeZone zone)
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.
- Parameters:
zone
- the time zone (null
not permitted).
- Returns:
- The first millisecond of the time period.
- See Also:
getLastMillisecond(TimeZone)
public abstract long getLastMillisecond()
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 thepeg(Calendar)
method.
- Returns:
- The last millisecond of the time period.
- See Also:
getFirstMillisecond()
public abstract long getLastMillisecond(Calendar calendar)
Returns the last millisecond of the time period, evaluated using the supplied calendar (which incorporates a timezone).
- Parameters:
calendar
- the calendar (null
not permitted).
- Returns:
- The last millisecond of the time period.
- See Also:
getFirstMillisecond(Calendar)
public long getLastMillisecond(TimeZone zone)
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.
- Parameters:
zone
- the time zone (null
not permitted).
- Returns:
- The last millisecond of the time period.
- See Also:
getFirstMillisecond(TimeZone)
public long getMiddleMillisecond()
Returns the millisecond closest to the middle of the time period.
- Returns:
- The middle millisecond.
public long getMiddleMillisecond(Calendar calendar)
Returns the millisecond closest to the middle of the time period, evaluated using the supplied calendar (which incorporates a timezone).
- Parameters:
calendar
- the calendar.
- Returns:
- The middle millisecond.
public long getMiddleMillisecond(TimeZone zone)
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.
- Parameters:
zone
- the time zone (null
not permitted).
- Returns:
- The middle millisecond.
public abstract long getSerialIndex()
Returns a serial index number for the time unit.
- Returns:
- The serial index number.
public Date getStart()
Returns the date/time that marks the start of the time period. This method returns a newDate
instance every time it is called.
- Specified by:
- getStart in interface TimePeriod
- Returns:
- The start date/time.
- See Also:
getFirstMillisecond()
public abstract RegularTimePeriod next()
Returns the time period following this one, ornull
if some limit has been reached.
- Returns:
- The next time period (possibly
null
).
public abstract void peg(Calendar calendar)
Recalculates the start date/time and end date/time for this time period relative to the supplied calendar (which incorporates a time zone).
- Parameters:
calendar
- the calendar (null
not permitted).
- Since:
- 1.0.3
public abstract RegularTimePeriod previous()
Returns the time period preceding this one, ornull
if some lower limit has been reached.
- Returns:
- The previous time period (possibly
null
).
public String toString()
Returns a string representation of the time period.
- Returns:
- The string.