Package opennlp.tools.util
Class StringList
java.lang.Object
opennlp.tools.util.StringList
The
StringList is an immutable list of Strings.-
Constructor Summary
ConstructorsConstructorDescriptionStringList(String singleToken) Initializes the current instance.StringList(String... tokens) Initializes the current instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleancompareToIgnoreCase(StringList tokens) Compares to tokens list and ignores the case of the tokens.booleangetToken(int index) Retrieves a token from the given index.inthashCode()iterator()Retrieves anIteratorover all tokens.intsize()Retrieves the number of tokens inside this list.toString()Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
StringList
Initializes the current instance. Note:
Token String will be replaced by identical internal String object.- Parameters:
singleToken- one single token
-
StringList
Initializes the current instance. Note:
Token Strings will be replaced by identical internal String object.- Parameters:
tokens- the string parts of the newStringList, an empty tokens array or null is not permitted.
-
-
Method Details
-
getToken
Retrieves a token from the given index.- Parameters:
index-- Returns:
- token at the given index
-
size
public int size()Retrieves the number of tokens inside this list.- Returns:
- number of tokens
-
iterator
Retrieves anIteratorover all tokens. -
compareToIgnoreCase
Compares to tokens list and ignores the case of the tokens. Note: This can cause problems with some locals.- Parameters:
tokens-- Returns:
- true if identically with ignore the case otherwise false
-
hashCode
public int hashCode() -
equals
-
toString
-