|
|||||||||
| 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.AbstractDatedMap
|
+--sos.dated.util.AbstractMapByKey
|
+--sos.dated.util.TreeMapByKey
An implementation of DatedSortedMap that uses an underlying
TreeMap to
keep all keys in sorted order and to achieve fast access to all keys.
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 map with a call to DatedCollections.synchronizedDatedMap.
TreeMapByDate,
HashMapByKey,
DatedMap,
DatedCollections.synchronizedDatedMap(DatedMap)| Nested Class Summary |
| Nested classes inherited from class sos.dated.util.DatedMap |
DatedMap.Entry |
| Field Summary |
| Fields inherited from interface sos.dated.util.DatedObject |
MAX_DATE, MIN_DATE |
| Constructor Summary | |
TreeMapByKey()
Creates a new instance of TreeMapByKey. |
|
TreeMapByKey(java.util.Comparator comparator)
Creates a new instance of TreeMapByKey that uses the specified
comparator to sort the keys. |
|
TreeMapByKey(DatedMap datedMap)
Creates a new instance of TreeMapByKey from the specified
dated map. |
|
TreeMapByKey(DatedSortedMap datedSortedMap)
Creates a new instance of TreeMapByKey from the specified
dated sorted map. |
|
| Method Summary | |
protected void |
checkForComodification(int expectedModCount,
java.util.Date date)
Throws a ConcurrentModificationException if the expected modification count does not equal the actual modification count for the specified date. |
java.lang.Object |
clone()
Creates and returns a copy of this object. |
java.util.Comparator |
comparator()
Returns the comparator used to sorted the keys of this dated map. |
boolean |
containsKey(java.lang.Object key,
java.util.Date date)
Returns true if this dated map contains the specified key at the
specified date. |
boolean |
containsKeyThroughout(java.lang.Object key,
java.util.Date from,
java.util.Date to)
Returns true if this dated map contains the specified key
throughout the specified date range. |
DateIterator |
dateIterator(java.util.Date date)
Returns an iterator of the date ranges of when this dated type has changed. |
DatedSet |
entrySet()
Returns a modifiable view of the mappings of this dated map. |
boolean |
excludesKeyThroughout(java.lang.Object key,
java.util.Date from,
java.util.Date to)
Returns true if this dated map does not contain the specified key
at any date within the specified date range. |
java.lang.Object |
firstKey(java.util.Date date)
Returns the smallest key in this dated map at the specified date. |
DatedValue |
get(java.lang.Object key)
Returns the values associated with the specified key for all dates. |
DatedSortedMap |
headMap(java.lang.Object toKey)
Returns a view of this dated map of all mappings whose keys precede toKey. |
java.lang.Object |
lastKey(java.util.Date date)
Returns the largest key in this dated map at the specified date. |
protected int |
modCount(java.util.Date date)
|
DatedValue |
put(java.lang.Object key,
java.lang.Object value,
java.util.Date from,
java.util.Date to)
Associates key with value in this dated map during
the specified date range. |
DatedValue |
remove(java.lang.Object key,
java.util.Date from,
java.util.Date to)
Removes any values associated with the specified key in the specified date range. |
DatedSortedMap |
subMap(java.lang.Object fromKey,
java.lang.Object toKey)
Returns a view of this dated map of all mappings whose keys fall between fromKey (inclusive) and toKey (exclusive). |
DatedSortedMap |
tailMap(java.lang.Object fromKey)
Returns a view of this dated map of all mappings whose keys are greater than or equal to toKey. |
protected void |
upModCount(java.util.Date from,
java.util.Date to)
|
| Methods inherited from class sos.dated.util.AbstractDatedMap |
clear, containsValue, containsValueThroughout, equals, excludesValueThroughout, get, hashCode, hasSizeThroughout, isEmpty, isEmptyThroughout, keySet, putAll, size, toString, values |
| 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.DatedMap |
clear, containsKey, containsKeyThroughout, containsValue, containsValueThroughout, entrySet, equals, excludesKeyThroughout, excludesValueThroughout, get, get, hashCode, hasSizeThroughout, isEmpty, isEmptyThroughout, keySet, put, putAll, remove, size, values |
| Methods inherited from interface sos.dated.util.DatedObject |
dateIterator, dateIterator, equals, hashCode, toString |
| Constructor Detail |
public TreeMapByKey()
TreeMapByKey.
public TreeMapByKey(java.util.Comparator comparator)
TreeMapByKey that uses the specified
comparator to sort the keys.
public TreeMapByKey(DatedMap datedMap)
TreeMapByKey from the specified
dated map.
public TreeMapByKey(DatedSortedMap datedSortedMap)
TreeMapByKey from the specified
dated sorted map.
| Method Detail |
public java.util.Comparator comparator()
DatedSortedMap
comparator in interface DatedSortedMappublic java.lang.Object clone()
AbstractDatedMapclone method.
clone in class sos.dated.util.AbstractMapByKeypublic java.lang.Object firstKey(java.util.Date date)
DatedSortedMap
firstKey in interface DatedSortedMapdate - date for which to find the smallest key
datepublic DatedSortedMap headMap(java.lang.Object toKey)
DatedSortedMap
headMap in interface DatedSortedMaptoKey - upper bound of the keys of the returned map (exclusive)
public java.lang.Object lastKey(java.util.Date date)
DatedSortedMap
lastKey in interface DatedSortedMapdate - date for which to find the largest key
date
public DatedSortedMap subMap(java.lang.Object fromKey,
java.lang.Object toKey)
DatedSortedMap
subMap in interface DatedSortedMapfromKey - lower bound of the keys of the returned map (inclusive)toKey - upper bound of the keys of the returned map (exclusive)
public DatedSortedMap tailMap(java.lang.Object fromKey)
DatedSortedMap
tailMap in interface DatedSortedMapfromKey - lower bound of the keys of the returned map (inclusive)
protected void checkForComodification(int expectedModCount,
java.util.Date date)
expectedModCount - the caller's expected modification countdate - the date in question
java.util.ConcurrentModificationException - if the expected modification
count does not equal the actual modification count for the specified date
public boolean containsKey(java.lang.Object key,
java.util.Date date)
DatedMaptrue if this dated map contains the specified key at the
specified date.
containsKey in interface DatedMapcontainsKey in class AbstractDatedMapkey - key whose presence is to be testeddate - date at which this map is to be queried
true if this dated map contains the specified key at the
specified date
public boolean containsKeyThroughout(java.lang.Object key,
java.util.Date from,
java.util.Date to)
DatedMaptrue if this dated map contains the specified key
throughout the specified date range.
containsKeyThroughout in interface DatedMapcontainsKeyThroughout in class AbstractDatedMapkey - key 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 dated map contains the specified key
throughout the specified date rangepublic DateIterator dateIterator(java.util.Date date)
dateIterator in interface DatedObjectdateIterator in class AbstractDatedObjectdate - date to position the iteration
java.lang.IllegalArgumentException - if from does not precede to
public boolean excludesKeyThroughout(java.lang.Object key,
java.util.Date from,
java.util.Date to)
DatedMaptrue if this dated map does not contain the specified key
at any date within the specified date range.
excludesKeyThroughout in interface DatedMapexcludesKeyThroughout in class AbstractDatedMapkey - key 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 dated map does not contain key key
between from and topublic DatedValue get(java.lang.Object key)
DatedMapput on this map. Setting
a value to null is not equivalent to removing the key from
this map. A null value may mean either that the key is associated with
null or that the key is not present in this map. (This behavior
is consistent with the specification of get in java.util.Map).
If this map does not support put, then set of the
dated value will throw an UnsupportedOperationException.
Iteration through the dates of the dated value may result in a
ConcurrentModificationException if this map's dates are altered during
the iteration.
get in interface DatedMapget in class AbstractDatedMapkey - key whose values are to be returned
keyprotected int modCount(java.util.Date date)
public DatedValue put(java.lang.Object key,
java.lang.Object value,
java.util.Date from,
java.util.Date to)
DatedMapkey with value in this dated map during
the specified date range.
put in interface DatedMapput in class AbstractDatedMapkey - key to put in this dated mapvalue - value to map to the keyfrom - starting date of the range (inclusive) to put the mappingto - ending date of the range (exclusive) to put the mapping
protected void upModCount(java.util.Date from,
java.util.Date to)
public DatedSet entrySet()
DatedMap
entrySet in interface DatedMapentrySet in class AbstractDatedMap
public DatedValue remove(java.lang.Object key,
java.util.Date from,
java.util.Date to)
DatedMap
remove in interface DatedMapremove in class AbstractDatedMapkey - key indicating which mapping to removefrom - starting date of the range (inclusive) to remove the mappingto - ending date of the range (exclusive) to remove the mapping
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||