public class StringSet extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static String |
ABBREV_DELIMITER
Default abbreviation delimiter is the asterisk (*) character.
|
static String |
VALUE_DELIMITER
Default value delimiter is the pipe (|) character.
|
Constructor and Description |
---|
StringSet()
Default constructor, creates a set with no initial values.
|
StringSet(String tokens)
Create a set with strings using the default value and abbreviation
delimiters.
|
StringSet(String[] strings)
Creates a set with the strings on the specified array as the initial
set of alternate values.
|
StringSet(String tokens,
String delimiter)
Creates a set using the tokens parsed from the given token string using
the supplied delimiter.
|
StringSet(String tokens,
String delimiter,
String abbreviationDelimiter)
Creates a set using the tokens parsed from the given token string using
the supplied delimiter.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(String string)
Adds the given string to the set.
|
boolean |
add(String string,
boolean checkName)
Adds the given string to the set, setting the name to the string value
if requested.
|
void |
addTokens(String tokens,
String delimiter)
Adds to the set a set the tokens parsed from the given token string
using the supplied delimiter.
|
void |
addTokens(String tokens,
String delimiter,
String abbreviationDelimiter)
Adds to set the tokens parsed from the given token string using the
supplied delimiter.
|
boolean |
contains(String string)
Checks if the string is contained in the set.
|
boolean |
containsIgnoreCase(String string)
Checks, using a case-insensitive method, if the string is contained in
the set.
|
String |
getName()
Returns the display name of this string set.
|
Set<String> |
getValues()
Returns a read-only set of values of this string set.
|
boolean |
remove(String string)
Removes the given string from the set.
|
String |
toString()
Returns the string image containing all alternate string values.
|
public static final String VALUE_DELIMITER
public static final String ABBREV_DELIMITER
public StringSet()
public StringSet(String tokens)
tokens
- A single string containing a series of tokens separated
from each other via the default delimiterspublic StringSet(String[] strings)
strings
- Array of individual strings to add to the string set
directly, i.e. without any parsing and processing of
abbreviations.public StringSet(String tokens, String delimiter)
tokens
- A single string containing a series of tokens separated
from each other via the specified delimiter.delimiter
- A single character string to use as a token delimiter.public StringSet(String tokens, String delimiter, String abbreviationDelimiter)
tokens
- A single string containing a series of tokens separated
from each other via the specified delimiter.delimiter
- A single character string to use as a token delimiter.abbreviationDelimiter
- A single character string to use as an
abbreviation delimiter.public String getName()
public Set<String> getValues()
public boolean add(String string)
string
- A string to add to the set, as-is, without any
processing.public boolean add(String string, boolean checkName)
string
- the string to be added to this set.checkName
- true to set the string set name to the given stringpublic boolean remove(String string)
string
- the string to be removed from this setpublic boolean contains(String string)
string
- string to be tested for membership in the setpublic boolean containsIgnoreCase(String string)
string
- string to be tested for membership in the setpublic void addTokens(String tokens, String delimiter)
tokens
- A single string containing a series of tokens separated
from each other via the specified delimiter.delimiter
- A single character string to use as a token delimiter.public void addTokens(String tokens, String delimiter, String abbreviationDelimiter)
tokens
- A single string containing a series of tokens separated
from each other via the specified delimiter.delimiter
- A single character string to use as a token delimiter.abbreviationDelimiter
- A single character string to use as an
abbreviation delimiter.Copyright © 2016. All Rights Reserved.