|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.util.ArrayCoreMap
edu.stanford.nlp.util.HashableCoreMap
public class HashableCoreMap
An extension of ArrayCoreMap
with an immutable set of key,value
pairs that is used for equality and hashcode comparisons.
Nested Class Summary | |
---|---|
static class |
HashableCoreMap.HashableCoreMapException
An exception thrown when attempting to change the value associated with an (immutable) hash key in a HashableCoreMap. |
Nested classes/interfaces inherited from interface edu.stanford.nlp.util.TypesafeMap |
---|
TypesafeMap.Key<BASE,VALUE> |
Constructor Summary | |
---|---|
HashableCoreMap(ArrayCoreMap other,
Set<Class<? extends TypesafeMap.Key<CoreMap,?>>> 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(Map<Class<? extends TypesafeMap.Key<CoreMap,?>>,Object> hashkey)
Creates an instance of HashableCoreMap with initial key,value pairs for the immutable, hashable keys as provided in the given map. |
Method Summary | ||
---|---|---|
boolean |
equals(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. |
|
|
set(Class<KEY> key,
VALUE value)
Sets the value associated with the given key; if the the key is one of the hashable keys, throws an exception. |
Methods inherited from class edu.stanford.nlp.util.ArrayCoreMap |
---|
compact, containsKey, get, has, keySet, remove, setCapacity, size, toShorterString, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HashableCoreMap(Map<Class<? extends TypesafeMap.Key<CoreMap,?>>,Object> hashkey)
public HashableCoreMap(ArrayCoreMap other, Set<Class<? extends TypesafeMap.Key<CoreMap,?>>> hashkey)
Method Detail |
---|
public <VALUEBASE,VALUE extends VALUEBASE,KEY extends TypesafeMap.Key<CoreMap,VALUEBASE>> VALUE set(Class<KEY> key, VALUE value)
set
in interface TypesafeMap<CoreMap>
set
in class ArrayCoreMap
HashableCoreMap.HashableCoreMapException
- Attempting to set the value for an
immutable, hashable key.public int hashCode()
hashCode
in class ArrayCoreMap
public boolean equals(Object o)
equals
in class ArrayCoreMap
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |