|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--sos.dated.util.AbstractDates
|
+--sos.dated.util.TreeDates
An implementation of Dates that uses a Red-Black tree to achieve logarithmic
insertions and deletions.
This implementation is serializable and cloneable; however, it is not
synchronized. To use it safely in a multi-threaded situation, wrap an
instance of the dated set with a call to DatedCollections.synchronizedDates.
Dates,
DatedCollections.synchronizedDates(Dates)| Constructor Summary | |
TreeDates()
|
|
TreeDates(Dates dates)
Creates an instance of TreeDates initialized with the ranges of dates. |
|
| Method Summary | |
Dates |
addAll(Dates series)
Adds all date ranges given by dates to this series of dates. |
Dates |
addRange(java.util.Date from,
java.util.Date to)
Adds a date range to this series of dates. |
void |
clear()
Removes all date ranges from this series of dates. |
java.lang.Object |
clone()
Creates and returns a copy of this object. |
void |
complement()
Modifies this Dates object so that it contains only the ranges not currently
in this Dates object. |
DateIterator |
dateIterator(java.util.Date date)
Returns an iterator over the date ranges, beginning with from,
inclusive, and ending with to, exclusive. |
boolean |
includes(java.util.Date date)
Indicates if a date range in this series contains the specified date. |
boolean |
isEmpty()
Indicates if this series of dates is empty. |
Dates |
removeAll(Dates series)
Removes all dates ranges given by dates from this series of dates. |
Dates |
removeRange(java.util.Date from,
java.util.Date to)
Removes the specified range from this series of dates. |
Dates |
retainAll(Dates series)
Removes all but the date ranges given by dates from this
series of dates. |
| Methods inherited from class sos.dated.util.AbstractDates |
dateIterator, equals, excludesAll, excludesRange, hashCode, includesAll, includesRange, size, toDateArray, toDateArray, toString |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface sos.dated.util.Dates |
dateIterator, equals, excludesAll, excludesRange, hashCode, includesAll, includesRange, size, toDateArray, toDateArray |
| Constructor Detail |
public TreeDates()
public TreeDates(Dates dates)
TreeDates initialized with the ranges of dates.
dates - date ranges for which to initialize this new TreeDates
java.lang.NullPointerException - if dates is null| Method Detail |
public Dates addAll(Dates series)
Datesdates to this series of dates.
The returned value indicates when this series of date ranges changed as
a result of the call and is applicable only for the specified date range.
It may be read-only, and it is not tied to this Dates object.
addAll in interface DatesaddAll in class AbstractDatesseries - series of dates to be added
public Dates addRange(java.util.Date from,
java.util.Date to)
Dates
The returned value indicates when this series of date ranges changed as
a result of the call and is applicable only for the specified date range.
It may be read-only, and it is not tied to this Dates object.
addRange in interface DatesaddRange in class AbstractDatesfrom - start of the date range, inclusiveto - end of the date range, exclusive
public void clear()
Dates
clear in interface Datesclear in class AbstractDatespublic java.lang.Object clone()
clone in class java.lang.Objectpublic void complement()
DatesDates object so that it contains only the ranges not currently
in this Dates object.
complement in interface Datescomplement in class AbstractDatespublic DateIterator dateIterator(java.util.Date date)
Datesfrom,
inclusive, and ending with to, exclusive.
dateIterator in interface DatesdateIterator in class AbstractDatespublic boolean includes(java.util.Date date)
Dates
includes in interface Datesincludes in class AbstractDatesdate - date to test for inclusion
true if this series of dates contains the specified datepublic boolean isEmpty()
Dates
isEmpty in interface DatesisEmpty in class AbstractDatestrue if no date ranges exist in this seriespublic Dates removeAll(Dates series)
Datesdates from this series of dates.
The returned value indicates when this series of date ranges changed as
a result of the call and is applicable only for the specified date range.
It may be read-only, and it is not tied to this Dates object.
removeAll in interface DatesremoveAll in class AbstractDatesseries - date ranges to be removed
public Dates removeRange(java.util.Date from,
java.util.Date to)
Dates
The returned value indicates when this series of date ranges changed as
a result of the call and is applicable only for the specified date range.
It may be read-only, and it is not tied to this Dates object.
removeRange in interface DatesremoveRange in class AbstractDatesfrom - start of date range to remove (inclusive)to - end of date range to remove (exclusive)
public Dates retainAll(Dates series)
Datesdates from this
series of dates.
The returned value indicates when this series of date ranges changed as
a result of the call and is applicable only for the specified date range.
It may be read-only, and it is not tied to this Dates object.
retainAll in interface DatesretainAll in class AbstractDatesseries - date ranges to retain
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||