public class StringSet extends SetBase
A set of value type string
.
Uses the property and function naming conventions of the JavaScript Set object.
Constructor and Description |
---|
StringSet()
See StringSet(int).
|
StringSet(int capacity)
Construct a new set with
StringSet.size of zero and optional initial capacity . |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String value)
Add
value to this set. |
StringSet |
addThis(java.lang.String value)
Add
value to this set. |
boolean |
delete(java.lang.String value)
Delete
value from this set. |
boolean |
has(java.lang.String value)
Return
true if this set contains value . |
StringList |
sortedValues()
Return the sorted values of this set.
|
StringList |
values()
Return a list of the values in this set.
|
public static final StringSet empty
public StringSet()
public StringSet(int capacity)
Construct a new set with StringSet.size
of zero and optional initial capacity
.
A set can expand in size beyond its initial capacity, but best performance
will be obtained if the initial capacity is close to the set's maximum size.
capacity
- Optional initial capacity.public void add(java.lang.String value)
Add value
to this set.
value
- Value to be added.public StringSet addThis(java.lang.String value)
Add value
to this set.
value
- Value to be added.public boolean delete(java.lang.String value)
Delete value
from this set.
value
- Value to be deleted.true
if the value was found (and deleted).public boolean has(java.lang.String value)
Return true
if this set contains value
.
value
- Value to be found.true
if this set contains value
.public StringList sortedValues()
Return the sorted values of this set.
public StringList values()
Return a list of the values in this set.