|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.anthonyeden.lib.util.DateRange
* This class represents a continuous date range. * * @author Anthony Eden
Constructor Summary | |
DateRange()
* Construct a new DateRange with null values for the start and * end date. |
|
DateRange(java.util.Date startDate,
java.util.Date endDate)
* Construct a new DateRanger with the given start and end date. |
Method Summary | |
java.util.Date |
getEndDate()
* Get the end date. |
double |
getSegmentCount(int segmentLength)
* Return the number of segments in the range given that * a segment is segmentLength milliseconds. |
java.util.Date |
getStartDate()
* Get the start date. |
boolean |
isWithinRange(java.util.Date date)
* Return true if the given Date is after the start date and before the end * date. |
void |
setEndDate(java.util.Date endDate)
* Set the end date. |
void |
setStartDate(java.util.Date startDate)
* Set the start date. |
java.lang.String |
toString()
* Return a String representation of the DateRange. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DateRange()
public DateRange(java.util.Date startDate, java.util.Date endDate)
Method Detail |
public java.util.Date getStartDate()
public void setStartDate(java.util.Date startDate)
public java.util.Date getEndDate()
public void setEndDate(java.util.Date endDate)
public boolean isWithinRange(java.util.Date date)
public double getSegmentCount(int segmentLength) throws java.lang.IllegalStateException
segmentLength
milliseconds.
*
* @param segmentLength Segment length in milliseconds
* @return The number of segments
* @throws IllegalStateException If either the start or end date are not set
java.lang.IllegalStateException
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |