|
Side of Software Dated Collections Library 2.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sos.dated.util.AbstractDatedObject<D> sos.dated.util.AbstractDatedMap<K,V,D> sos.dated.util.AbstractMapByDate<K,V,D> sos.dated.util.HashMapByDate<K,V,D>
K
- the type of keys maintained by this dated mapV
- the type of values maintained by this dated mapD
- the type of dates used by this dated mappublic class HashMapByDate<K,V,D>
An implementation of DatedMap
that maintains a java.util.HashMap
at each date where a change occurs, yielding fast date iterations and fast retrievals.
The following illustration shows a conceptual view of a small HashMapByDate
where the "dates" are integers, the keys are characters, and the values are special
characters:
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
.
HashMapByKey
,
TreeMapByDate
,
DatedMap
,
DatedCollections.synchronizedDatedMap(DatedMap)
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface sos.dated.util.DatedMap |
---|
DatedMap.Entry<K,V,D> |
Constructor Summary | |
---|---|
HashMapByDate()
Constructs an instance of HashMapByDate
with a default initial capacity (16) and a default
load factor (0.75). |
|
HashMapByDate(DatedMap<? extends K,? extends V,D> datedMap)
Constructs an instance of HashMapByDate initialized with the mappings of
datedMap . |
|
HashMapByDate(int initialCapacity)
Constructs an instance of HashMapByDate
with the specified initial capacity and a default
load factor (0.75). |
|
HashMapByDate(int initialCapacity,
float loadFactor)
Constructs an instance of HashMapByDate
with the specified initial capacity and
load factor. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Creates and returns a shallow copy of this object. |
protected java.util.Map<K,V> |
createMap(D from,
D to)
Returns a freshly created, empty HashMap . |
Methods inherited from class sos.dated.util.AbstractMapByDate |
---|
checkForComodification, containsKey, containsValue, copyMap, dateIterator, entrySet, get, modCount, put, putAll, remove, upModCount |
Methods inherited from class sos.dated.util.AbstractDatedMap |
---|
clear, containsKeyThroughout, containsValueThroughout, equals, excludesKeyThroughout, excludesValueThroughout, get, hashCode, hasSizeThroughout, isEmpty, isEmptyThroughout, keySet, 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 HashMapByDate()
HashMapByDate
with a default initial capacity (16) and a default
load factor (0.75).
public HashMapByDate(int initialCapacity)
HashMapByDate
with the specified initial capacity and a default
load factor (0.75).
initialCapacity
- the initial capacity at all dates
java.lang.IllegalArgumentException
- if initialCapacity < 0
public HashMapByDate(int initialCapacity, float loadFactor)
HashMapByDate
with the specified initial capacity and
load factor.
initialCapacity
- the initial capacity at all datesloadFactor
- the load factor at all dates
java.lang.IllegalArgumentException
- if initialCapacity < 0
or
if loadFactor <= 0.0
public HashMapByDate(DatedMap<? extends K,? extends V,D> datedMap)
HashMapByDate
initialized with the mappings of
datedMap
.
datedMap
- dated map with which to initialize this HashMapByDate
java.lang.NullPointerException
- if datedMap
is null
.Method Detail |
---|
public java.lang.Object clone()
clone
in class AbstractMapByDate<K,V,D>
protected java.util.Map<K,V> createMap(D from, D to)
HashMap
.
createMap
in class AbstractMapByDate<K,V,D>
from
- start date (inclusive) for which to create the mapto
- end date (exclusive) for which to create the map
HashMap
.
|
Side of Software Dated Collections Library 2.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |