Constructor and Description |
---|
MysterySetImplementation() |
Modifier and Type | Method and Description |
---|---|
void |
add(T item)
Adds the given item to the set, ignoring duplicates.
|
void |
clear()
Removes all items from the set.
|
boolean |
contains(T item)
Returns whether the given item is in the set.
|
boolean |
isEmpty()
Returns true if the set is empty.
|
java.util.Iterator<T> |
iterator()
Returns an iterator over the items in the set (which will access the
items in some arbitrary order).
|
boolean |
remove(T item)
Removes the given item.
|
int |
size()
Returns the number of items in the set.
|
java.lang.Object[] |
toArray()
Returns an array containing the same contents as this set, in an
arbitrary order.
|
java.lang.String |
toString()
Returns, e.g., "{val1; val2; val3}".
|
public void add(T item)
Set
public boolean contains(T item)
Set
public boolean isEmpty()
Set
public int size()
Set
public void clear()
Set
public java.util.Iterator<T> iterator()
Set
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object[] toArray()
Set