public final class EmptySet<E>
extends java.util.AbstractSet<E>
Set
interface is required for an API, but the set must be
empty. It overrides the minimum AbstractSet
methods
necessary to function as a read-only, empty set. Elements may not be
added.Modifier and Type | Field and Description |
---|---|
private java.util.Iterator<E> |
emptyIter
Empty iterator which is stateless, so it is safe to share
|
Constructor and Description |
---|
EmptySet() |
Modifier and Type | Method and Description |
---|---|
java.util.Iterator<E> |
iterator()
Return an iterator that never has a next element, and which does not
support element removal.
|
int |
size()
Return a size of zero, to indicate the set is empty.
|
add, addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait