Class Attributes
- java.lang.Object
-
- opennlp.tools.dictionary.serializer.Attributes
-
public class Attributes extends Object
TheAttributes
class stores name value pairs.Problem: If a
HashMap
is used storing name-value pairs this results in a very high memory footprint, replace it.
-
-
Constructor Summary
Constructors Constructor Description Attributes()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getValue(String key)
Retrieves the value for the given key ornull
if attribute it not set.Iterator<String>
iterator()
Iterates over the keys.void
setValue(String key, String value)
Sets a key/value pair.
-
-
-
Method Detail
-
getValue
public String getValue(String key)
Retrieves the value for the given key ornull
if attribute it not set.- Parameters:
key
- The key to get the desired value for.- Returns:
- The value for the given key or
null
-
setValue
public void setValue(String key, String value)
Sets a key/value pair.- Parameters:
key
- The key that uniquely identifies the specifiedvalue
. Must not benull
.value
- The value that shall be retrievable via itskey
. Must not benull
.
-
-