T
- The type of data storedpublic class DictionaryData<T>
extends java.lang.Object
add(String, Object)
done()
when done adding data (required!)
#lookUp(String, boolean)
Constructor and Description |
---|
DictionaryData(Language language) |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String key,
T value)
Insert a key=value pair into the data store.
|
void |
done()
Finalize the data store.
|
java.util.List<java.util.Map.Entry<java.lang.String,T>> |
lookUp(java.lang.String word)
Look up the given word.
|
java.util.List<java.util.Map.Entry<java.lang.String,T>> |
lookUpPredictive(java.lang.String word)
Look up the given word using predictive completion; e.g.
|
int |
size()
Get the number of stored keys.
|
public DictionaryData(Language language)
language
- The dictionary's index languagepublic void add(java.lang.String key, T value)
key
- The keyvalue
- The valuepublic void done()
public java.util.List<java.util.Map.Entry<java.lang.String,T>> lookUp(java.lang.String word) throws java.lang.IllegalStateException
word
- The word to look upjava.lang.IllegalStateException
- If done()
has not yet been calledpublic java.util.List<java.util.Map.Entry<java.lang.String,T>> lookUpPredictive(java.lang.String word) throws java.lang.IllegalStateException
word
- The word to look upjava.lang.IllegalStateException
- If done()
has not yet been calledpublic int size()
-1
if done()
has not yet been called.