MPXJ: Microsoft Project Exchange

net.sf.mpxj
Class DateRange

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

public final class DateRange
extends java.lang.Object
implements java.lang.Comparable<DateRange>

This class represents a period of time.


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

Field Detail

EMPTY_RANGE

public static final DateRange EMPTY_RANGE
Constructor Detail

DateRange

public DateRange(java.util.Date startDate,
                 java.util.Date endDate)
Constructor.

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

getStart

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

Returns:
start date

getEnd

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

Returns:
end date

compareTo

public int compareTo(java.util.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 java.lang.Comparable<DateRange>

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object


Copyright © 2000-2009 Packwood Software. All Rights Reserved.