final class SmallSet<T>
extends java.util.AbstractSet<T>
Modifier and Type | Class and Description |
---|---|
(package private) static class |
SmallSet.IteratorImpl<T> |
Modifier and Type | Field and Description |
---|---|
private T |
element1
The first element of this set, maybe null.
|
private T |
element2
The second element of this set, maybe null.
|
Modifier | Constructor and Description |
---|---|
(package private) |
SmallSet()
Constructs an empty set.
|
(package private) |
SmallSet(T element)
Constructs a set with exactly one element.
|
private |
SmallSet(T element1,
T element2)
Constructs a new
SmallSet . |
Modifier and Type | Method and Description |
---|---|
java.util.Iterator<T> |
iterator() |
int |
size() |
(package private) java.util.Set<T> |
union(SmallSet<T> otherSet)
Returns the union of this set and of the given set.
|
add, addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
private final T element1
private final T element2
SmallSet()
SmallSet(T element)
element
- the unique set element.public java.util.Iterator<T> iterator()
public int size()