|
|||||||||
| 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.AbstractMapByDate
A partial implementation of DatedMap that maintains a complete, non-dated
map at each date where a change occurs. This class allows the client to use
a custom implementation of java.util.Map inside a date-indexed map with
minimal effort. To do so, simply extend this class and implement the abstract
createMap method.
| 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 | |
protected |
AbstractMapByDate()
No-argument constructor available only to subclasses. |
| 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. |
protected java.lang.Object |
clone()
Creates and returns a copy of this object. |
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 |
containsValue(java.lang.Object value,
java.util.Date date)
Returns true if any key maps to the specified value at the
specified date. |
protected java.util.Map |
copyMap(java.util.Map map)
Returns a fresh map equivalent to the specified map. |
protected abstract java.util.Map |
createMap()
|
DateIterator |
dateIterator(java.util.Date date)
Returns an iterator of the dates of when this dated type has changed. |
DatedSet |
entrySet()
Returns a modifiable view of the mappings of this dated map. |
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. |
protected void |
upModCount(java.util.Date from,
java.util.Date to)
|
| Methods inherited from class sos.dated.util.AbstractDatedMap |
clear, containsKeyThroughout, containsValueThroughout, equals, excludesKeyThroughout, excludesValueThroughout, get, 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, containsKeyThroughout, containsValueThroughout, equals, excludesKeyThroughout, excludesValueThroughout, get, get, hashCode, hasSizeThroughout, isEmpty, isEmptyThroughout, keySet, putAll, size, values |
| Methods inherited from interface sos.dated.util.DatedObject |
dateIterator, equals, hashCode, toString |
| Constructor Detail |
protected AbstractMapByDate()
| Method Detail |
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
protected java.lang.Object clone()
throws java.lang.CloneNotSupportedException
AbstractDatedMapclone method.
clone in class AbstractDatedMapjava.lang.CloneNotSupportedException - if this object's class does not
support the Cloneable interface.
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 containsValue(java.lang.Object value,
java.util.Date date)
DatedMaptrue if any key maps to the specified value at the
specified date.
containsValue in interface DatedMapcontainsValue in class AbstractDatedMapvalue - value whose presence is to be testeddate - date at which this map is to be queried
true if any key maps to the specified value at the
specified dateprotected java.util.Map copyMap(java.util.Map map)
map - mappings to be included in the new map
protected abstract java.util.Map createMap()
public DateIterator dateIterator(java.util.Date date)
dateIterator in interface DatedObjectdateIterator in class AbstractDatedObjectdate - date to position the iteration
public DatedSet entrySet()
DatedMap
entrySet in interface DatedMapentrySet in class AbstractDatedMapprotected 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
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
protected void upModCount(java.util.Date from,
java.util.Date to)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||