|
Side of Software Dated Collections Library 2.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
E - the type of elements maintained by this dated setD - the type of dates used by this dated setpublic interface DatedSet<E,D>
A set of elements over time. A dated set is a dated collection with the additional
requirement that an element appear at most once at a given
date. This interface is based on the interface java.util.Set.
The following table compares the efficiencies of the four implementations
in this package. Each cell is the average big-Oh notation, where T denotes the
number of dates in the set and N denotes the number of elements at any given
date.
HashSetByDate HashSetByKey TreeSetByDate TreeSetByKey add T*N T T*N T+log(N) clear T T*N T T*N contains log(T) log(T) log(T)+log(N) log(T)+log(N) containsThroughout T T T*log(N) T+log(N) dateIterator log(T) T*N log(T) T*N hashCode T*N T*N T*N T*N hashCode(d) log(T)+N log(T)*N log(T)+N log(T)*N remove T*N T T*N T+log(N) size log(T) log(T) log(T) log(T)
This interface does not extend java.util.Set directly
because at least one date is needed. To make a dated set appear
like a non-dated set, use Adapters.asSet(DatedSet,Date).
Similarly, to treat a non-dated set as dated, use
Adapters.asDatedSet(Set,Date,Date).
HashSetByDate,
HashSetByElement,
TreeSetByDate,
TreeSetByElement,
Adapters.asSet(DatedSet,Object),
Adapters.asDatedSet(Set,Object,Object)| Method Summary | |
|---|---|
boolean |
equals(D at,
DatedObject<D> obj,
D objAt)
Indicates if this dated set at date is equal to
obj at objDate. |
int |
hashCode(D at)
Returns a hash code value of this dated set at the specified date. |
| Methods inherited from interface sos.dated.util.DatedCollection |
|---|
add, addAll, clear, contains, containsAll, containsThroughout, excludesThroughout, hasSizeThroughout, isEmpty, isEmptyThroughout, iterator, remove, removeAll, retainAll, size, toArray, toArray |
| Methods inherited from interface sos.dated.util.DatedObject |
|---|
dateIterator, dateIterator, equals, hashCode, toString |
| Method Detail |
|---|
boolean equals(D at,
DatedObject<D> obj,
D objAt)
date is equal to
obj at objDate.
Two sets are equivalent at the specified dates if their sizes
are equal and one set contains all elements of the other set.
equals in interface DatedObject<D>at - date at which this object should be testedobj - the other dated object to be compared toobjAt - the date of the other dated object
true if this dated set at date equals
another dated object at objDate
java.lang.NullPointerException - if any argument is nullint hashCode(D at)
DatedSet at a date is calculated the same way as in
hashCode of java.util.Set.
hashCode in interface DatedObject<D>at - date to which the value should correspond
java.lang.NullPointerException - if date is null
|
Side of Software Dated Collections Library 2.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||