| java.lang.Object org.jfree.data.time.SimpleTimePeriod
SimpleTimePeriod | public class SimpleTimePeriod implements TimePeriod,Comparable,Serializable(Code) | | An arbitrary period of time, measured to millisecond precision using
java.util.Date .
This class is intentionally immutable (that is, once constructed, you cannot
alter the start and end attributes).
|
Method Summary | |
public int | compareTo(Object obj) Returns an integer that indicates the relative ordering of two
time periods.
Parameters: obj - the object (null not permitted). | public boolean | equals(Object obj) Tests this time period instance for equality with an arbitrary object. | public Date | getEnd() Returns the end date/time. | public Date | getStart() Returns the start date/time. | public int | hashCode() Returns a hash code for this object instance. |
SimpleTimePeriod | public SimpleTimePeriod(long start, long end)(Code) | | Creates a new time allocation.
Parameters: start - the start date/time in milliseconds. Parameters: end - the end date/time in milliseconds. |
SimpleTimePeriod | public SimpleTimePeriod(Date start, Date end)(Code) | | Creates a new time allocation.
Parameters: start - the start date/time (null not permitted). Parameters: end - the end date/time (null not permitted). |
compareTo | public int compareTo(Object obj)(Code) | | Returns an integer that indicates the relative ordering of two
time periods.
Parameters: obj - the object (null not permitted). An integer. throws: ClassCastException - if obj is not an instance ofTimePeriod. |
equals | public boolean equals(Object obj)(Code) | | Tests this time period instance for equality with an arbitrary object.
The object is considered equal if it is an instance of
TimePeriod and it has the same start and end dates.
Parameters: obj - the other object (null permitted). A boolean. |
getEnd | public Date getEnd()(Code) | | Returns the end date/time.
The end date/time (never null ). |
getStart | public Date getStart()(Code) | | Returns the start date/time.
The start date/time (never null ). |
hashCode | public int hashCode()(Code) | | Returns a hash code for this object instance. The approach described by
Joshua Bloch in "Effective Java" has been used here - see:
http://developer.java.sun.com/
developer/Books/effectivejava/Chapter3.pdf
A hash code. |
|
|