| Constructor and Description |
|---|
ArrayIntSet() |
ArrayIntSet(ArrayIntSet other) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int value)
Adds a new integer to this set.
|
void |
addAll(IntSet values)
Adds all the integers from another set to this set.
|
boolean |
contains(int value)
Checks if the given integer value is in this set.
|
IntSet |
copy()
Creates a copy of this set.
|
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isEmpty()
Cehcks if the set is empty.
|
IntIterator |
iterator()
An iterator over the values of this set.
|
int |
max()
Returns the maximum integer in this set.
|
int |
min()
Returns the minimum integer in this set.
|
void |
remove(int value)
Remove the given integer value from this set.
|
int |
size()
Returns the number of elements in the set.
|
String |
toString() |
IntSet |
union(IntSet values)
Creates a new IntSet that is the union of this set and the given set.
|
public ArrayIntSet()
public ArrayIntSet(ArrayIntSet other)
public void add(int value)
public void addAll(IntSet values)
public boolean contains(int value)
public IntSet copy()
public boolean isEmpty()
public IntIterator iterator()
public int max()
public int min()
public void remove(int value)
public int size()
Copyright © 2019. All rights reserved.