|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object biz.chitec.quarterback.util.EDateRange
Java representation of a date range with EDate start and end point. A date range consists simply of a start (inclusive), an end (exclusive). An empty date range can be expressed by start=end. Note however that EDateRange by itself does not enforce any consistency checks on start and end time setting. However, the mathematical operations assume silently that the date range is consistent (end equals or later than start).
EDateMultiRange
,
Serialized FormField Summary | |
EDate |
end
|
EDate |
start
|
Constructor Summary | |
protected |
EDateRange()
Empty constructor, only needed for derived classes. |
|
EDateRange(EDate s,
EDate e)
Constructor with start and end. |
|
EDateRange(EDateRange b)
Copy constructor. |
Method Summary | |
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
boolean |
contains(EDate d)
Returns whether the given date is in the range, which is interpreted as half-open with the start belonging to it but not the end. |
boolean |
contains(EDateRange other)
true iff this contains other completely. |
void |
cumulate(EDateRange other)
cumulates this date range with the other. |
EDate |
duration()
return duration of the date range |
boolean |
endsEqual(EDateRange other)
true iff this and other end at the same time |
boolean |
endsLaterThan(EDateRange other)
true iff this ends later than other |
boolean |
equals(java.lang.Object o)
true iff o is a EDateRange and starts and ends at the same times as this. |
EDate |
getEnd()
return end date |
EDate |
getStart()
return stadt date |
void |
intersect(EDateRange other)
Intersect myself with another booking. |
boolean |
isCorrect()
returns whether the date range ends later than it starts |
boolean |
isEmpty()
Returns whether the date range is empty, i.e. start and end are equal |
boolean |
overlaps(EDateRange other)
true iff this and other overlap anyhow. |
EDateRange |
remainder(EDateRange other)
calculates remainder of this date range with the other date range. |
void |
setEnd(EDate d)
Set the end time of the interval. |
void |
setStart(EDate d)
Set the start time of the interval. |
boolean |
startsEqual(EDateRange other)
true iff this and other start at the same time |
boolean |
startsLaterThan(EDateRange other)
true iff this starts later than other. |
java.lang.String |
toString()
returns String representation of this. |
void |
unite(EDateRange other)
unifies this date range with the other. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public EDate start
public EDate end
Constructor Detail |
protected EDateRange()
public EDateRange(EDate s, EDate e)
s
- Start date of the date rangee
- End date of the date rangepublic EDateRange(EDateRange b)
b
- Copy sourceMethod Detail |
public void setStart(EDate d)
d
- New start datepublic void setEnd(EDate d)
d
- New end datepublic EDate getStart()
public EDate getEnd()
public boolean isCorrect()
public boolean isEmpty()
public boolean startsLaterThan(EDateRange other)
public boolean startsEqual(EDateRange other)
public boolean endsLaterThan(EDateRange other)
public boolean endsEqual(EDateRange other)
public EDate duration()
public boolean overlaps(EDateRange other)
public boolean contains(EDate d)
d
- Date in question
public boolean contains(EDateRange other)
public EDateRange remainder(EDateRange other)
public void unite(EDateRange other)
public void intersect(EDateRange other)
other
- Another time range to intersect this withpublic void cumulate(EDateRange other)
public boolean equals(java.lang.Object o)
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public java.lang.String toString()
|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |