public class UntypedSet
extends java.lang.Object
An untyped set, intended for internal use by strongly-typed sets which inherit from the SetBase
class.
Constructor and Description |
---|
UntypedSet(int capacity)
Construct a new set with
UntypedSet.size of zero and specified initial capacity . |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.Object value)
Add
value into this set. |
void |
clear()
Remove all values from this set.
|
void |
copyValuesTo(UntypedList list)
Copy the values in this set to the
list argument. |
boolean |
delete(java.lang.Object value)
Delete
value from this set. |
boolean |
has(java.lang.Object value)
Return
true if this set contains value . |
boolean |
isEmpty()
true if this set contains no entries. |
boolean |
isMutable()
true if this set is mutable. |
int |
size()
The number of values in this set.
|
java.lang.String |
toString()
Return a string representation of this set.
|
UntypedList |
values()
Return a list of the values in this set.
|
public UntypedSet(int capacity)
Construct a new set with UntypedSet.size
of zero and specified 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
- Initial capacity.public void add(java.lang.Object value)
Add value
into this set.
value
- (nullable) Value to be added.public void clear()
Remove all values from this set.
public void copyValuesTo(UntypedList list)
Copy the values in this set to the list
argument.
list
- List to receive copied values.public boolean delete(java.lang.Object value)
Delete value
from this set.
value
- (nullable) Value to be deleted.true
if the value was found (and deleted).public boolean has(java.lang.Object value)
Return true
if this set contains value
.
value
- (nullable) Value to be found.true
if this set contains value
.public boolean isEmpty()
true
if this set contains no entries.
public boolean isMutable()
true
if this set is mutable.
public int size()
The number of values in this set.
public java.lang.String toString()
Return a string representation of this set.
toString
in class java.lang.Object
public UntypedList values()
Return a list of the values in this set.