Package edu.stanford.nlp.util
Interface CoreMap
-
- All Superinterfaces:
PrettyLoggable,Serializable,TypesafeMap
- All Known Implementing Classes:
Annotation,ArrayCoreMap,CoreLabel,HashableCoreMap
public interface CoreMap extends TypesafeMap, PrettyLoggable, Serializable
Base type for all annotatable core objects. Should usually be instantiated asArrayCoreMap. Many common key definitions live inCoreAnnotations, but others may be defined elsewhere. SeeCoreAnnotationsfor details. Note that implementations of this interface must take care to implement equality correctly: by default, two CoreMaps are .equal if they contain the same keys and all corresponding values are .equal. Subclasses that wish to change this behavior (such asHashableCoreMap) must make sure that all other CoreMap implementations have a special case in their .equals to use that equality definition when appropriate. Similarly, care must be taken when defining hashcodes. The default hashcode is 37 * sum of all keys' hashcodes plus the sum of all values' hashcodes. However, use of this class as HashMap keys is discouraged because the hashcode can change over time. Consider using aHashableCoreMap.- Author:
- dramage, rafferty
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface edu.stanford.nlp.util.TypesafeMap
TypesafeMap.Key<VALUE>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringtoShorterString(String... what)Attempt to provide a briefer and more human readable String for the contents of a CoreMap.-
Methods inherited from interface edu.stanford.nlp.util.logging.PrettyLoggable
prettyLog
-
Methods inherited from interface edu.stanford.nlp.util.TypesafeMap
containsKey, get, keySet, remove, set, size
-
-
-
-
Method Detail
-
toShorterString
String toShorterString(String... what)
Attempt to provide a briefer and more human readable String for the contents of a CoreMap. The method may not be capable of printing circular dependencies in CoreMaps.- Parameters:
what- An array (varargs) of Strings that say what annotation keys to print. These need to be provided in a shortened form where you are just giving the part of the class name without package and up to "Annotation". That is, edu.stanford.nlp.ling.CoreAnnotations.PartOfSpeechAnnotation ➔ PartOfSpeech . As a special case, an empty array means to print everything, not nothing.- Returns:
- A more human readable String giving possibly partial contents of a CoreMap.
-
-