public class TimePeriod
extends java.lang.Object
implements java.lang.Comparable
TimePeriod
class is a container for a date and
length of time.Constructor and Description |
---|
TimePeriod(java.util.Date startDate,
long duration)
Creates a new time period.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object o) |
long |
getDuration()
Gets the time period duration in milliseconds.
|
java.util.Date |
getEndDate()
Gets the time period ending date.
|
java.util.Date |
getStartDate()
Gets the time period starting date.
|
public TimePeriod(java.util.Date startDate, long duration)
startDate
- the time period starting date.duration
- the time period duration in milliseconds.public java.util.Date getStartDate()
public long getDuration()
public java.util.Date getEndDate()
public int compareTo(java.lang.Object o) throws java.lang.ClassCastException
compareTo
in interface java.lang.Comparable
java.lang.ClassCastException