|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--portlets.compoze.groupware.calendar.DateRange
This class represents a duration in time, consisting of a start and an end
date. Either date may be null
, which indicates that the duration extends
infinitely in time in that direction. It is always assured upon construction
and modification of the starting and ending dates that the start is before
the end.
Field Summary | |
static int |
OVERLAP_ADJACENT
The combination of flags indicating that the second duration in time is adjacent to the first. |
static int |
OVERLAP_ADJACENT_AFTER
The flag indicating that the second duration in time occurs partially after the first duration. |
static int |
OVERLAP_ADJACENT_BEFORE
The flag indicating that the second duration in time occurs before the first duration, and its end is equal to the start of the first duration. |
static int |
OVERLAP_ANY
The combination of flags indicating that the second duration in time occurs partially before, within, equal to, encompassing, or partially after the first duration. |
static int |
OVERLAP_EARLIER
The combination of flags indicating that the second duration in time occurs either totally, adjacent to or partially before the first duration. |
static int |
OVERLAP_ENCOMPASS
The flag indicating that the second duration in time totally encompasses the first duration. |
static int |
OVERLAP_EQUAL
The flag indicating that the first and second durations are equal. |
static int |
OVERLAP_LATER
The combination of flags indicating that the second duration in time occurs either totally, adjacent to or partially after the first duration. |
static int |
OVERLAP_NONE
The combination of flags indicating that the second duration in time does not in any way overlap, or is merely adjacent to the first duration. |
static int |
OVERLAP_PARTIALLY_AFTER
The flag indicating that the second duration in time occurs partially after the first duration. |
static int |
OVERLAP_PARTIALLY_BEFORE
The flag indicating that the second duration in time occurs partially before the first duration. |
static int |
OVERLAP_TOTALLY_AFTER
The flag indicating that the second duration in time occurs totally after the first duration. |
static int |
OVERLAP_TOTALLY_BEFORE
The flag indicating that the second duration in time occurs totally before the first duration. |
static int |
OVERLAP_WITHIN
The flag indicating that the second duration in time occurs totally within the first duration. |
Constructor Summary | |
DateRange(java.util.Date start,
java.util.Date end)
Constructor. |
Method Summary | |
long |
addDuration(DateRange duration)
Adds this duration to another duration. |
java.util.Date |
addDurationToDate(java.util.Date start)
Adds this duration to another date. |
void |
assignDuration(long lDuration)
Sets the duration of the event by changing the end date if necessary. |
int |
compareTo(java.lang.Object o)
Compares this date range with the specified date range for ordering. |
boolean |
equals(java.lang.Object o)
Equals. |
long |
getDuration()
Gets the duration between the starting and ending dates. |
java.util.Date |
getEnd()
Gets the ending date. |
java.util.Date |
getStart()
Gets the starting date. |
int |
overlap(DateRange duration)
Evaluates the overlap between this and a second duration. |
void |
setEnd(java.util.Date end)
Sets the ending date. |
void |
setStart(java.util.Date start)
Sets the starting date. |
java.lang.String |
toString()
Creates a string representation of the date range. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int OVERLAP_TOTALLY_BEFORE
public static final int OVERLAP_ADJACENT_BEFORE
public static final int OVERLAP_PARTIALLY_BEFORE
public static final int OVERLAP_WITHIN
public static final int OVERLAP_EQUAL
public static final int OVERLAP_ENCOMPASS
public static final int OVERLAP_PARTIALLY_AFTER
public static final int OVERLAP_ADJACENT_AFTER
public static final int OVERLAP_TOTALLY_AFTER
public static final int OVERLAP_ANY
public static final int OVERLAP_NONE
public static final int OVERLAP_EARLIER
public static final int OVERLAP_LATER
public static final int OVERLAP_ADJACENT
Constructor Detail |
public DateRange(java.util.Date start, java.util.Date end)
start
- the starting dateend
- the ending dateMethod Detail |
public void setStart(java.util.Date start)
start
- the starting datepublic java.util.Date getStart()
public void setEnd(java.util.Date end)
end
- the ending datepublic java.util.Date getEnd()
public void assignDuration(long lDuration)
lDuration
- the new durationpublic long getDuration()
java.lang.ArithmeticException
- if the duration is infinitepublic java.util.Date addDurationToDate(java.util.Date start)
startDate
- the starting date to add the duration tojava.lang.ArithmeticException
- if the duration is infinitepublic long addDuration(DateRange duration)
duration
- the second durationjava.lang.ArithmeticException
- if the resulting duration is infinitepublic int overlap(DateRange duration)
duration
- the second durationpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- duration to compare topublic int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- the other date rangepublic java.lang.String toString()
toString
in class java.lang.Object
|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |