public class HashableCoreMap extends ArrayCoreMap
ArrayCoreMap with an immutable set of key,value
pairs that is used for equality and hashcode comparisons.| Modifier and Type | Class and Description |
|---|---|
static class |
HashableCoreMap.HashableCoreMapException
An exception thrown when attempting to change the value associated
with an (immutable) hash key in a HashableCoreMap.
|
TypesafeMap.Key<VALUE>| Constructor and Description |
|---|
HashableCoreMap(ArrayCoreMap other,
java.util.Set<java.lang.Class<? extends TypesafeMap.Key<?>>> hashkey)
Creates an instance by copying values from the given other CoreMap,
using the values it associates with the given set of hashkeys for
the immutable, hashable keys used by hashcode and equals.
|
HashableCoreMap(java.util.Map<java.lang.Class<? extends TypesafeMap.Key<?>>,java.lang.Object> hashkey)
Creates an instance of HashableCoreMap with initial key,value pairs
for the immutable, hashable keys as provided in the given map.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o)
If the provided object is a HashableCoreMap, equality is based only
upon the values of the immutable hashkeys; otherwise, defaults to
behavior of the superclass's equals method.
|
int |
hashCode()
Provides a hash code based on the immutable keys and values provided
to the constructor.
|
<VALUE> VALUE |
set(java.lang.Class<? extends TypesafeMap.Key<VALUE>> key,
VALUE value)
Sets the value associated with the given key; if the the key is one
of the hashable keys, throws an exception.
|
compact, containsKey, get, has, keySet, prettyLog, remove, setCapacity, size, toShorterString, toShortString, toShortString, toStringpublic HashableCoreMap(java.util.Map<java.lang.Class<? extends TypesafeMap.Key<?>>,java.lang.Object> hashkey)
public HashableCoreMap(ArrayCoreMap other, java.util.Set<java.lang.Class<? extends TypesafeMap.Key<?>>> hashkey)
public <VALUE> VALUE set(java.lang.Class<? extends TypesafeMap.Key<VALUE>> key, VALUE value)
set in interface TypesafeMapset in class ArrayCoreMapHashableCoreMap.HashableCoreMapException - Attempting to set the value for an
immutable, hashable key.public int hashCode()
hashCode in class ArrayCoreMappublic boolean equals(java.lang.Object o)
equals in class ArrayCoreMap