|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--sos.dated.util.AbstractDatedObject
|
+--sos.dated.util.AbstractDatedCollection
|
+--sos.dated.util.AbstractDatedSet
|
+--sos.dated.util.AbstractMapBackedSet
|
+--sos.dated.util.HashSetByElement
An implementation of DatedSet that uses a HashMapByKey as its underlying
data structure.
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.synchronizedDatedSet.
HashSetByDate,
TreeSetByElement,
DatedSet,
HashMapByKey,
DatedCollections.synchronizedDatedSet(DatedSet)| Field Summary |
| Fields inherited from interface sos.dated.util.DatedObject |
MAX_DATE, MIN_DATE |
| Constructor Summary | |
HashSetByElement()
Creates a new instance of HashSetByElement. |
|
HashSetByElement(DatedCollection datedCollection)
Creates a new instance of HashSetByElement initialized with the elements
and dates of the specified dated collection. |
|
HashSetByElement(int initialCapacity)
Creates a new instance of HashSetByElement with the specified initial capacity
and default load factor (0.75). |
|
HashSetByElement(int initialCapacity,
float loadFactor)
Creates a new instance of HashSetByElement with the
specified initial capacity and load factor. |
|
| Method Summary | |
Dates |
add(java.lang.Object value,
java.util.Date from,
java.util.Date to)
Adds the specified element to this collection for the specified date range (optional operation). |
void |
clear(java.util.Date from,
java.util.Date to)
Removes all elements from this dated collection for the specified dates (optional operation). |
java.lang.Object |
clone()
Creates and returns a copy of this object. |
boolean |
contains(java.lang.Object value,
java.util.Date date)
Returns true if this collection contains the specified element
on the specified date. |
boolean |
containsThroughout(java.lang.Object value,
java.util.Date from,
java.util.Date to)
Returns true if this collection contains the specified element
throughout the specified date range. |
DateIterator |
dateIterator(java.util.Date date)
Returns an iterator of the date ranges of when this dated object has changed, starting at the range that contains the specified date. |
boolean |
excludesThroughout(java.lang.Object value,
java.util.Date from,
java.util.Date to)
Returns true if this collection does not contain the specified
element at any date within the specified date range. |
boolean |
hasSizeThroughout(int size,
java.util.Date from,
java.util.Date to)
Returns true if the number of elements in this collection is
greater than or equal to the specified size throughout the specified
date range. |
boolean |
isEmpty(java.util.Date date)
Returns true if this collection contains no elements on the
specified date. |
boolean |
isEmptyThroughout(java.util.Date from,
java.util.Date to)
Returns true if this collection contains no elements throughout the
specified date range. |
Iterator |
iterator(java.util.Date date)
Returns an iterator over the elements of this dated collection at the specified date. |
Dates |
remove(java.lang.Object value,
java.util.Date from,
java.util.Date to)
Removes an instance of the specified element from this collection for the specified date range (optional operation). |
int |
size(java.util.Date date)
Returns the number of elements in this collection at the specified date. |
| Methods inherited from class sos.dated.util.AbstractDatedSet |
equals, hashCode |
| Methods inherited from class sos.dated.util.AbstractDatedCollection |
addAll, containsAll, removeAll, retainAll, toArray, toArray, toString |
| Methods inherited from class sos.dated.util.AbstractDatedObject |
dateIterator, equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface sos.dated.util.DatedSet |
equals, hashCode |
| 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 |
| Constructor Detail |
public HashSetByElement()
HashSetByElement.
public HashSetByElement(DatedCollection datedCollection)
HashSetByElement initialized with the elements
and dates of the specified dated collection.
datedCollection - collection with which to initialize the new
HashSetByElementpublic HashSetByElement(int initialCapacity)
HashSetByElement with the specified initial capacity
and default load factor (0.75).
The initial capacity is used to initialize the underlying HashMapByKey,
which holds all elements across all time.
initialCapacity - initial capacity of the underlying hash map
public HashSetByElement(int initialCapacity,
float loadFactor)
HashSetByElement with the
specified initial capacity and load factor.
initialCapacity - load capacity of the underlying hash maploadFactor - load factor of the underlying hash map| Method Detail |
public java.lang.Object clone()
clone in class java.lang.Object
public Dates add(java.lang.Object value,
java.util.Date from,
java.util.Date to)
DatedCollectionThe returned value indicates when this dated collection 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 dated collection.
add in interface DatedCollectionadd in class AbstractDatedCollectionvalue - element to addfrom - starting date at which the element should be addedto - ending date at which the element should be added
public void clear(java.util.Date from,
java.util.Date to)
DatedCollection
clear in interface DatedCollectionclear in class AbstractDatedCollectionfrom - date to start clearing the collection, inclusiveto - date to finish clearing the collection, exclusive
public boolean contains(java.lang.Object value,
java.util.Date date)
DatedCollectiontrue if this collection contains the specified element
on the specified date.
contains in interface DatedCollectioncontains in class AbstractDatedCollectionvalue - element whose presence is to be testeddate - date at which this collection is to be queried
true if this collection contains the specified element
on the specified date
public boolean containsThroughout(java.lang.Object value,
java.util.Date from,
java.util.Date to)
DatedCollectiontrue if this collection contains the specified element
throughout the specified date range.
containsThroughout in interface DatedCollectioncontainsThroughout in class AbstractDatedCollectionvalue - element whose presence is to be testedfrom - starting date (inclusive) at which containment should be testedto - ending date (exclusive) at which containment should be tested
true if this collection contains the specified element
throughout the specified date rangepublic DateIterator dateIterator(java.util.Date date)
DatedObjectnextFrom returns the
same date as previousTo.
Passing MAX_DATE as the argument will return an iterator positioned
at the end of the sequence.
dateIterator in interface DatedObjectdateIterator in class AbstractDatedCollectiondate - date to position the iteration
public boolean excludesThroughout(java.lang.Object value,
java.util.Date from,
java.util.Date to)
DatedCollectiontrue if this collection does not contain the specified
element at any date within the specified date range.
excludesThroughout in interface DatedCollectionexcludesThroughout in class AbstractDatedCollectionvalue - element whose presence is to be testedfrom - starting date (inclusive) at which exclusion should be testedto - ending date (exclusive) at which exclusion should be tested
true if this collection does not contain value
at any date between from and to
public boolean hasSizeThroughout(int size,
java.util.Date from,
java.util.Date to)
DatedCollectiontrue if the number of elements in this collection is
greater than or equal to the specified size throughout the specified
date range.
hasSizeThroughout in interface DatedCollectionhasSizeThroughout in class AbstractDatedCollectionsize - number of elements in questionfrom - starting date (inclusive) at which the size is to be comparedto - ending date (exclusive) at which the size is to be compared
true if this collection has at least the specified size
throughout the specified date range.public boolean isEmpty(java.util.Date date)
DatedCollectiontrue if this collection contains no elements on the
specified date.
isEmpty in interface DatedCollectionisEmpty in class AbstractDatedCollectiondate - date at which this collection is to be queried
true if this collection contains no elements on the
specified date
public boolean isEmptyThroughout(java.util.Date from,
java.util.Date to)
DatedCollectiontrue if this collection contains no elements throughout the
specified date range.
isEmptyThroughout in interface DatedCollectionisEmptyThroughout in class AbstractDatedCollectionfrom - starting date at which this collection is to be queriedto - ending date at which this collection is to be queried
true if this collection contains no elements throughout the
specified date range.public Iterator iterator(java.util.Date date)
DatedCollectionUnsupportedOperationException in its remove
method because a date range is required to remove an element from
this dated collection.
iterator in interface DatedCollectioniterator in class AbstractDatedCollectiondate - date at which to iterate through the elements
public Dates remove(java.lang.Object value,
java.util.Date from,
java.util.Date to)
DatedCollectionThe returned value indicates when this dated collection 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 dated collection.
remove in interface DatedCollectionremove in class AbstractDatedCollectionvalue - element to removefrom - starting date at which the element should be removedto - ending date at which the element should be removed
public int size(java.util.Date date)
DatedCollection
size in interface DatedCollectionsize in class AbstractDatedCollectiondate - date at which this collection is to be queried
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||