com.std.util.range
Class DateRange

java.lang.Object
extended by com.std.util.range.DateRange
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DayRange, GridMonthRange, MonthRange, WeekRange

public class DateRange
extends java.lang.Object
implements java.io.Serializable

represents a constant range of dates

Author:
xxx
See Also:
Serialized Form

Field Summary
static long serialVersionUID
           
 
Constructor Summary
DateRange()
          creates a new DateRange where the start and end dates are set to the moment of creation
DateRange(java.util.Date date)
          start and end dates are set to the given date
DateRange(java.util.Date startDate, java.util.Date endDate)
          start and end dates are set to the given dates
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 double getDurationInDays()
           
 long getDurationInMS()
           
 java.util.Date getEndDate()
           
 java.util.Date getStartDate()
           
 int hashCode()
           
protected  void setEndDate(java.util.Date endDate)
          changes the end date of the range
protected  void setStartDate(java.util.Date startDate)
          changes the start date of the range
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

DateRange

public DateRange()
creates a new DateRange where the start and end dates are set to the moment of creation


DateRange

public DateRange(java.util.Date date)
start and end dates are set to the given date

Parameters:
date - the start and end dates of the range

DateRange

public DateRange(java.util.Date startDate,
java.util.Date endDate)
start and end dates are set to the given dates

Parameters:
startDate - the start date of the range
endDate - the end date of the range
Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getDurationInDays

public double getDurationInDays()
Returns:
the length of the range in days

getDurationInMS

public long getDurationInMS()
Returns:
the length of the range in milliseconds

getEndDate

public java.util.Date getEndDate()
Returns:
the end date of the range

getStartDate

public java.util.Date getStartDate()
Returns:
the start date of the range

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

setEndDate

protected void setEndDate(java.util.Date endDate)
changes the end date of the range

Parameters:
endDate - the end date of the range

setStartDate

protected void setStartDate(java.util.Date startDate)
changes the start date of the range

Parameters:
startDate - the start date of the range

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object