public class ArraySet<T> extends AbstractSet<T> implements Serializable
contains(Object) are linear time.| Modifier and Type | Class and Description |
|---|---|
class |
ArraySet.ArraySetIterator |
| Constructor and Description |
|---|
ArraySet() |
ArraySet(ArraySet<T> other) |
ArraySet(int n,
boolean checkDupes) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T o) |
boolean |
addAll(ArraySet<T> other) |
void |
clear() |
boolean |
contains(Object obj_) |
static <T> ArraySet<T> |
empty() |
void |
forall(ObjectVisitor<T> visitor) |
T |
get(int i) |
boolean |
intersects(ArraySet<T> other) |
Iterator<T> |
iterator() |
static <T> ArraySet<T> |
make() |
static <T> ArraySet<T> |
make(Collection<T> other) |
boolean |
remove(int ind) |
boolean |
remove(Object obj_) |
int |
size() |
equals, hashCode, removeAlladdAll, containsAll, isEmpty, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAll, containsAll, isEmpty, retainAll, spliterator, toArray, toArrayparallelStream, removeIf, streampublic ArraySet(int n,
boolean checkDupes)
public ArraySet()
public ArraySet(ArraySet<T> other) throws IllegalArgumentException
IllegalArgumentExceptionpublic static final <T> ArraySet<T> empty()
public boolean add(T o)
add in interface Collection<T>add in interface Set<T>add in class AbstractCollection<T>UnsupportedOperationException - if this ArraySet is immutable (optional)public boolean addAll(ArraySet<T> other) throws IllegalArgumentException
IllegalArgumentExceptionpublic boolean contains(Object obj_)
contains in interface Collection<T>contains in interface Set<T>contains in class AbstractCollection<T>public boolean intersects(ArraySet<T> other) throws IllegalArgumentException
IllegalArgumentExceptionpublic void forall(ObjectVisitor<T> visitor)
public int size()
size in interface Collection<T>size in interface Set<T>size in class AbstractCollection<T>public T get(int i)
IndexOutOfBoundsException - if the index is out of range (index < 0 || index >=
size()).public boolean remove(Object obj_)
remove in interface Collection<T>remove in interface Set<T>remove in class AbstractCollection<T>public boolean remove(int ind)
true (SJF: So why return a value?)public void clear()
clear in interface Collection<T>clear in interface Set<T>clear in class AbstractCollection<T>public Iterator<T> iterator()
iterator in interface Iterable<T>iterator in interface Collection<T>iterator in interface Set<T>iterator in class AbstractCollection<T>Set.iterator()public static <T> ArraySet<T> make()
public static <T> ArraySet<T> make(Collection<T> other) throws IllegalArgumentException
IllegalArgumentException