Package opennlp.tools.util
Klasse StringList
java.lang.Object
opennlp.tools.util.StringList
A
StringList
is an immutable list of String
s.-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungStringList
(boolean isCaseSensitive, String... tokens) Initializes aStringList
instance.StringList
(String singleToken) Initializes aStringList
instance.StringList
(String... tokens) Initializes aStringList
instance. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungboolean
compareToIgnoreCase
(StringList tokens) Compares totoken list
and ignores the case of the tokens.boolean
getToken
(int index) int
hashCode()
boolean
iterator()
int
size()
toString()
Von Schnittstelle geerbte Methoden java.lang.Iterable
forEach, spliterator
-
Konstruktordetails
-
StringList
Initializes aStringList
instance. By default, this instance is case-sensitive.Note:
Token String will be interned viaStringInterners
.- Parameter:
singleToken
- One single token
-
StringList
Initializes aStringList
instance. By default, this instance is case-sensitive.Note:
Token Strings will be interned viaStringInterners
.- Parameter:
tokens
- The string parts of the newStringList
. Must not be an empty tokens array ornull
.- Löst aus:
IllegalArgumentException
- Thrown if parameters were invalid.
-
StringList
Initializes aStringList
instance.Note:
Token Strings will be interned viaStringInterners
.- Parameter:
isCaseSensitive
- Whether it will operate case-sensitive, or not.tokens
- The string parts of the newStringList
. Must not be an empty tokens array ornull
.- Löst aus:
IllegalArgumentException
- Thrown if parameters were invalid.
-
-
Methodendetails
-
getToken
- Parameter:
index
- The index to get a token from.- Gibt zurück:
- Retrieves a token from the given
index
.
-
size
public int size()- Gibt zurück:
- Retrieves the number of tokens inside this list.
-
iterator
-
compareToIgnoreCase
Compares totoken list
and ignores the case of the tokens. Note: This can cause problems with some locales.- Parameter:
tokens
- Thetokens
used for comparison.- Gibt zurück:
true
if identically with ignore the case,false
otherwise.
-
hashCode
public int hashCode() -
equals
-
toString
- Setzt außer Kraft:
toString
in KlasseObject
- Gibt zurück:
- A human-readable representation of this
StringList
.
-
isCaseSensitive
public boolean isCaseSensitive()- Gibt zurück:
true
, if thisStringList
is case-sensitive.
-
toCaseInsensitive
- Gibt zurück:
- If this
StringList
is case-insensitive, the same instance is returned. Otherwise, a new object is returned.
-
toCaseSensitive
- Gibt zurück:
- If this
StringList
is case-sensitive, the same instance is returned. Otherwise, a new object is returned.
-