sos.dated.util
Class IdentityHashMapByDate
java.lang.Object
|
+--sos.dated.util.AbstractDatedObject
|
+--sos.dated.util.AbstractDatedMap
|
+--sos.dated.util.AbstractMapByDate
|
+--sos.dated.util.IdentityHashMapByDate
- All Implemented Interfaces:
- java.lang.Cloneable, DatedMap, DatedObject, java.io.Serializable
- public class IdentityHashMapByDate
- extends AbstractMapByDate
- implements DatedMap, java.io.Serializable, java.lang.Cloneable
A special-purpose, non-conforming implementation of DatedMap
that uses identity equality and
identity hash code by maintaining a java.util.IdentityHashMap
at each date.
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 synchronizedDatedMap.
- Since:
- 1.0
- See Also:
IdentityHashMapByKey,
DatedMap,
DatedCollections.synchronizedDatedMap(DatedMap)
|
Method Summary |
java.lang.Object |
clone()
Creates and returns a copy of this object. |
protected java.util.Map |
createMap()
|
DatedValue |
get(java.lang.Object key)
Returns the values associated with the specified key for all dates. |
| Methods inherited from class sos.dated.util.AbstractDatedMap |
clear, containsKeyThroughout, containsValueThroughout, equals, excludesKeyThroughout, excludesValueThroughout, get, hashCode, hasSizeThroughout, isEmpty, isEmptyThroughout, keySet, putAll, size, toString, values |
| 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, hashCode, hasSizeThroughout, isEmpty, isEmptyThroughout, keySet, put, putAll, remove, size, values |
IdentityHashMapByDate
public IdentityHashMapByDate()
- Creates a new instance of
IdentityHashMapByDate.
IdentityHashMapByDate
public IdentityHashMapByDate(DatedMap datedMap)
- Constructs a new instance of
IdentityHashMapByDate initialized with the mappings of
datedMap.
- Parameters:
datedMap - dated map with which to initialize this IdentityHashMapByDate
- Throws:
java.lang.NullPointerException - if datedMap is null.
clone
public java.lang.Object clone()
- Description copied from class:
AbstractDatedMap
- Creates and returns a copy of this object.
Subclasses that wish to be cloneable should override this method
but first call their parent's
clone method.
- Overrides:
clone in class AbstractMapByDate
- Returns:
- a copy of this dated map
createMap
protected java.util.Map createMap()
- Specified by:
createMap in class AbstractMapByDate
get
public DatedValue get(java.lang.Object key)
- Description copied from interface:
DatedMap
- Returns the values associated with the specified key for all dates. The
returned dated value is backed by this dated map. Thus, changes to the
dated value are reflected in this map and vice versa. Setting a value
in the dated value is equivalent to invoking
put 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.
- Specified by:
get in interface DatedMap- Overrides:
get in class AbstractDatedMap
- Parameters:
key - key whose values are to be returned
- Returns:
- a dated value of the values associated with
key
Copyright 2003 Side of Software (SOS). All rights reserved.