public final class SetInt extends Object implements Serializable
Constructor and Description |
---|
SetInt()
Create a set of default size
|
SetInt(int initialCapacity)
Create a set of given size
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(int key)
Add a value to the set
|
void |
clear()
clear all the entries
|
boolean |
contains(int key)
Find a value from the set
|
boolean |
isEmpty()
is the set empty
|
IteratorInt |
iterator()
get an iterator to go through the set
|
boolean |
remove(int key)
Remove a value from the set
|
int |
size()
get the number of used entries
|
int[] |
toArray()
convert to an array
|
public SetInt()
public SetInt(int initialCapacity)
initialCapacity
- public boolean add(int key)
key
- the value to addpublic boolean remove(int key)
key
- the value to addpublic boolean contains(int key)
key
- the value to findpublic int size()
public boolean isEmpty()
public void clear()
public IteratorInt iterator()
public int[] toArray()