net.sf.mpxj
Class DateRange

java.lang.Object
  extended by net.sf.mpxj.DateRange
All Implemented Interfaces:
Comparable<DateRange>

public final class DateRange
extends Object
implements Comparable<DateRange>

This class represents a period of time.


Field Summary
static DateRange EMPTY_RANGE
           
 
Constructor Summary
DateRange(Date startDate, Date endDate)
          Constructor.
 
Method Summary
 int compareTo(Date date)
          This method compares a target date with a date range.
 int compareTo(DateRange o)
          
 boolean equals(Object o)
          
 Date getEnd()
          Retrieve the date at the end of the range.
 Date getStart()
          Retrieve the date at the start of the range.
 int hashCode()
          
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_RANGE

public static final DateRange EMPTY_RANGE
Constructor Detail

DateRange

public DateRange(Date startDate,
                 Date endDate)
Constructor.

Parameters:
startDate - start date
endDate - end date
Method Detail

getStart

public Date getStart()
Retrieve the date at the start of the range.

Returns:
start date

getEnd

public Date getEnd()
Retrieve the date at the end of the range.

Returns:
end date

compareTo

public int compareTo(Date date)
This method compares a target date with a date range. The method will return 0 if the date is within the range, less than zero if the date is before the range starts, and greater than zero if the date is after the range ends.

Parameters:
date - target date
Returns:
comparison result

compareTo

public int compareTo(DateRange o)

Specified by:
compareTo in interface Comparable<DateRange>

equals

public boolean equals(Object o)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.