Package opennlp.tools.util
Class StringList
java.lang.Object
opennlp.tools.util.StringList
A 
StringList is an immutable list of Strings.- 
Constructor SummaryConstructorsConstructorDescriptionStringList(boolean isCaseSensitive, String... tokens) Initializes aStringListinstance.StringList(String singleToken) Initializes aStringListinstance.StringList(String... tokens) Initializes aStringListinstance.
- 
Method SummaryModifier and TypeMethodDescriptionbooleancompareToIgnoreCase(StringList tokens) Compares totoken listand ignores the case of the tokens.booleangetToken(int index) inthashCode()booleaniterator()intsize()toString()Methods inherited from interface java.lang.IterableforEach, spliterator
- 
Constructor Details- 
StringListInitializes aStringListinstance. By default, this instance is case-sensitive.Note: 
 Token String will be interned viaStringInterners.- Parameters:
- singleToken- One single token
 
- 
StringListInitializes aStringListinstance. By default, this instance is case-sensitive.Note: 
 Token Strings will be interned viaStringInterners.- Parameters:
- tokens- The string parts of the new- StringList. Must not be an empty tokens array or- null.
- Throws:
- IllegalArgumentException- Thrown if parameters were invalid.
 
- 
StringListInitializes aStringListinstance.Note: 
 Token Strings will be interned viaStringInterners.- Parameters:
- isCaseSensitive- Whether it will operate case-sensitive, or not.
- tokens- The string parts of the new- StringList. Must not be an empty tokens array or- null.
- Throws:
- IllegalArgumentException- Thrown if parameters were invalid.
 
 
- 
- 
Method Details- 
getToken- Parameters:
- index- The index to get a token from.
- Returns:
- Retrieves a token from the given index.
 
- 
sizepublic int size()- Returns:
- Retrieves the number of tokens inside this list.
 
- 
iterator
- 
compareToIgnoreCaseCompares totoken listand ignores the case of the tokens. Note: This can cause problems with some locales.- Parameters:
- tokens- The- tokensused for comparison.
- Returns:
- trueif identically with ignore the case,- falseotherwise.
 
- 
hashCodepublic int hashCode()
- 
equals
- 
toString- Overrides:
- toStringin class- Object
- Returns:
- A human-readable representation of this StringList.
 
- 
isCaseSensitivepublic boolean isCaseSensitive()- Returns:
- true, if this- StringListis case-sensitive.
 
- 
toCaseInsensitive- Returns:
- If this StringListis case-insensitive, the same instance is returned. Otherwise, a new object is returned.
 
- 
toCaseSensitive- Returns:
- If this StringListis case-sensitive, the same instance is returned. Otherwise, a new object is returned.
 
 
-