|
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.EDateMultiRange
Multiple date ranges in one storage. The EDateMultiRange knows about automatically splitting and unifying a time range. It implements true versions of unite(), intersect() and remainder(). The multirange has a correct understanding of an empty range (being an empty list of ranges). Internally, this class manages a list of ranges. for the sake of efficiency, this class can perform its work somewhen between the call to a changing method and the query of the result, including the query method itself.
Field Summary | |
private boolean |
normalized
|
private java.util.List |
subranges
|
Constructor Summary | |
EDateMultiRange()
Creates an empty multirange. |
|
EDateMultiRange(EDateMultiRange o)
Creates a new and completely independant copy of the given multirange. |
|
EDateMultiRange(EDateRange r)
Creates a multi range containing only the given range. |
Method Summary | |
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
boolean |
equals(java.lang.Object o)
true iff o is a EDateMultiRange and starts and ends at the same times as this. |
int |
getChunkCount()
Returns the count of non-linear chunks. |
java.util.List |
getChunks()
Return the chunks of multirange. |
EDateRange |
getEnvelope()
Return the minimum envelope of the multirange, i.e. the time range from the first subrange's beginning to the end of the last range. |
void |
intersect(EDateMultiRange other)
Intersect the multirange with another timerange. |
boolean |
isEmpty()
Returns whether the multirange is empty, i.e. there are no subranges left. |
boolean |
isSingular()
Returns whether the multirange is sigular, i.e. there is exactly one subrange. |
private void |
normalize()
Normlizes the multirange internally. |
void |
remainder(EDateMultiRange other)
Calculates the remainder of this against all chunks of other. |
void |
remainder(EDateRange other)
Calculates remainder of this multi range with the other date range. |
java.lang.String |
toString()
returns String representation of this. |
void |
unite(EDateMultiRange other)
Unite the multirange with all contents of the other multirange |
void |
unite(EDateRange other)
Unite the multirange with yet another range. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private java.util.List subranges
private boolean normalized
Constructor Detail |
public EDateMultiRange()
public EDateMultiRange(EDateMultiRange o)
public EDateMultiRange(EDateRange r)
r
- A date range to initialize the multirange with.Method Detail |
private void normalize()
public void remainder(EDateRange other)
public void remainder(EDateMultiRange other)
other
- other list of changes.public void unite(EDateRange other)
public void unite(EDateMultiRange other)
public void intersect(EDateMultiRange other)
public int getChunkCount()
public boolean isEmpty()
public boolean isSingular()
public java.util.List getChunks()
public EDateRange getEnvelope()
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 |