Constructor and Description |
---|
UnitMap(Body b)
maps each unit of this body to the result of
mapTo .before the mapping the method init is called.the internal hashtable is initialized without any parameter. |
UnitMap(Body b,
int initialCapacity)
maps each unit of this body to the result of
mapTo .before the mapping the method init is called.the internal hashtable is initialized to initialCapacity . |
UnitMap(Body b,
int initialCapacity,
float loadFactor)
maps each unit of this body to the result of
mapTo .before the mapping the method init is called.the internal hashtable is initialized to initialCapacity and
loadFactor . |
UnitMap(UnitGraph g)
maps each unit of the graph to the result of
mapTo .before the mapping the method init is called.the internal hashtable is initialized without any parameter. |
UnitMap(UnitGraph g,
int initialCapacity)
maps each unit of the graph to the result of
mapTo .before the mapping the method init is called.the internal hashtable is initialized to initialCapacity . |
UnitMap(UnitGraph g,
int initialCapacity,
float loadFactor)
maps each unit of the graph to the result of
mapTo .before the mapping the method init is called.the internal hashtable is initialized to initialCapacity and
loadFactor . |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Set<java.util.Map.Entry<Unit,T>> |
entrySet() |
boolean |
equals(java.lang.Object o) |
T |
get(java.lang.Object key) |
int |
hashCode() |
protected void |
init()
allows one-time initialization before any mapping.
|
boolean |
isEmpty() |
java.util.Set<Unit> |
keySet() |
protected abstract T |
mapTo(Unit unit)
maps a unit to an object.
|
T |
put(Unit key,
T value) |
void |
putAll(java.util.Map<? extends Unit,? extends T> t) |
T |
remove(java.lang.Object key) |
int |
size() |
java.util.Collection<T> |
values() |
public UnitMap(Body b)
mapTo
.init
is called.b
- a Bodypublic UnitMap(UnitGraph g)
mapTo
.init
is called.g
- a UnitGraphpublic UnitMap(Body b, int initialCapacity)
mapTo
.init
is called.initialCapacity
.b
- a BodyinitialCapacity
- the initialCapacity of the internal hashtable.public UnitMap(UnitGraph g, int initialCapacity)
mapTo
.init
is called.initialCapacity
.g
- a UnitGraphinitialCapacity
- the initialCapacity of the internal hashtable.public UnitMap(Body b, int initialCapacity, float loadFactor)
mapTo
.init
is called.initialCapacity
and
loadFactor
.b
- a BodyinitialCapacity
- the initialCapacity of the internal hashtable.loadFactor
- the loadFactor of the internal hashtable.public UnitMap(UnitGraph g, int initialCapacity, float loadFactor)
mapTo
.init
is called.initialCapacity
and
loadFactor
.g
- a UnitGraphinitialCapacity
- the initialCapacity of the internal hashtable.loadFactor
- the loadFactor of the internal hashtable.protected void init()
protected abstract T mapTo(Unit unit)
null
no object will be mapped.the
- Unit to which o
should be mapped.null
.public boolean containsKey(java.lang.Object key)
public boolean containsValue(java.lang.Object value)
public boolean equals(java.lang.Object o)
public int hashCode()
public T remove(java.lang.Object key)