net.sf.oness.common.model.temporal
Class DateRange

java.lang.Object
  extended bynet.sf.oness.common.all.BaseObject
      extended bynet.sf.oness.common.model.temporal.DateRange
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class DateRange
extends net.sf.oness.common.all.BaseObject

Range of dates

Version:
$Revision: 1.5 $
Author:
Carlos Sanchez
See Also:
Serialized Form

Field Summary
static DateRange EMPTY
           
 
Fields inherited from class net.sf.oness.common.all.BaseObject
log
 
Constructor Summary
DateRange()
           
DateRange(Date start, Date end)
          Create a date range from start to end
 
Method Summary
 boolean abuts(DateRange arg)
           
 java.lang.Object clone()
           
static DateRange combination(DateRange[] args)
           
 int compareTo(java.lang.Object arg)
           
 void endNow()
           
 DateRange gap(DateRange arg)
           
 Date getEnd()
           
 Date getStart()
           
 boolean includes(Date arg)
           
 boolean includes(DateRange arg)
           
static boolean isContiguous(DateRange[] args)
           
 boolean isEmpty()
           
 boolean isOpen()
           
 long lengthInDays()
          Calculates the length of this range in days.
 long lengthInMinutes()
          Calculates the length of this range in minutes.
 boolean overlaps(DateRange arg)
           
 boolean partitionedBy(DateRange[] args)
           
 void setEnd(Date end)
          Set the end date
 void setStart(Date start)
          Set the start date
static DateRange startingAndEndingNow()
           
static DateRange startingNow()
           
static DateRange startingOn(Date start)
           
 java.lang.String toString()
           
static DateRange upTo(Date end)
           
 
Methods inherited from class net.sf.oness.common.all.BaseObject
equals, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static DateRange EMPTY
Constructor Detail

DateRange

public DateRange()

DateRange

public DateRange(Date start,
                 Date end)
Create a date range from start to end

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

setStart

public void setStart(Date start)
Set the start date

Parameters:
start - start date

getStart

public Date getStart()

setEnd

public void setEnd(Date end)
Set the end date

Parameters:
end - end date

getEnd

public Date getEnd()

isEmpty

public boolean isEmpty()

isOpen

public boolean isOpen()

includes

public boolean includes(Date arg)

endNow

public void endNow()

upTo

public static DateRange upTo(Date end)

startingOn

public static DateRange startingOn(Date start)

startingNow

public static DateRange startingNow()

startingAndEndingNow

public static DateRange startingAndEndingNow()

overlaps

public boolean overlaps(DateRange arg)

includes

public boolean includes(DateRange arg)

gap

public DateRange gap(DateRange arg)

compareTo

public int compareTo(java.lang.Object arg)

abuts

public boolean abuts(DateRange arg)

partitionedBy

public boolean partitionedBy(DateRange[] args)

combination

public static DateRange combination(DateRange[] args)

isContiguous

public static boolean isContiguous(DateRange[] args)

lengthInDays

public long lengthInDays()
Calculates the length of this range in days.

Returns:
The number of days in this range. Zero is returned if the dates are the same. Long.MAX_VALUE is returned if this is an open range.

lengthInMinutes

public long lengthInMinutes()
Calculates the length of this range in minutes.

Returns:
The number of minutes in this range. Zero is returned if the dates are the same. Long.MAX_VALUE is returned if this is an open range.

toString

public java.lang.String toString()

clone

public java.lang.Object clone()
See Also:
Object.clone()


Copyright © 2003-2005 ONess Project. All Rights Reserved.