public class Dictionary extends java.lang.Object implements java.lang.Iterable<StringList>, SerializableArtifact
| Constructor and Description |
|---|
Dictionary()
Initializes an empty
Dictionary. |
Dictionary(boolean caseSensitive) |
Dictionary(java.io.InputStream in)
Initializes the
Dictionary from an existing dictionary resource. |
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<java.lang.String> |
asStringSet()
Gets this dictionary as a
Set<String>. |
boolean |
contains(StringList tokens)
Checks if this dictionary has the given entry.
|
boolean |
equals(java.lang.Object obj) |
java.lang.Class<?> |
getArtifactSerializerClass()
Gets the Serializer Class for
Dictionary |
int |
getMaxTokenCount() |
int |
getMinTokenCount() |
int |
hashCode() |
java.util.Iterator<StringList> |
iterator()
Retrieves an Iterator over all tokens.
|
static Dictionary |
parseOneEntryPerLine(java.io.Reader in)
Reads a dictionary which has one entry per line.
|
void |
put(StringList tokens)
Adds the tokens to the dictionary as one new entry.
|
void |
remove(StringList tokens)
Removes the given tokens form the current instance.
|
void |
serialize(java.io.OutputStream out)
Writes the current instance to the given
OutputStream. |
int |
size()
Retrieves the number of tokens in the current instance.
|
java.lang.String |
toString() |
public Dictionary()
Dictionary.public Dictionary(boolean caseSensitive)
public Dictionary(java.io.InputStream in)
throws java.io.IOException
Dictionary from an existing dictionary resource.in - InputStreamjava.io.IOExceptionpublic void put(StringList tokens)
tokens - the new entrypublic int getMinTokenCount()
public int getMaxTokenCount()
public boolean contains(StringList tokens)
tokens - querypublic void remove(StringList tokens)
tokens - filter tokenspublic java.util.Iterator<StringList> iterator()
iterator in interface java.lang.Iterable<StringList>Iteratorpublic int size()
public void serialize(java.io.OutputStream out)
throws java.io.IOException
OutputStream.out - OutputStreamjava.io.IOExceptionpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic static Dictionary parseOneEntryPerLine(java.io.Reader in) throws java.io.IOException
in - Readerjava.io.IOExceptionpublic java.util.Set<java.lang.String> asStringSet()
Set<String>. Only iterator(),
size() and contains(Object) methods are implemented.
If this dictionary entries are multi tokens only the first token of the
entry will be part of the Set.public java.lang.Class<?> getArtifactSerializerClass()
DictionarygetArtifactSerializerClass in interface SerializableArtifactDictionarySerializerCopyright © 2010 - 2023 Adobe. All Rights Reserved