E - the element typepublic class MapDelegateSet<E>
extends java.util.AbstractSet<E>
implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<E,java.lang.Object> |
map
The delegate map
|
private static java.lang.Object |
PRESENT
The dummy object
|
private static long |
serialVersionUID
The serialVersionUID
|
| Constructor and Description |
|---|
MapDelegateSet(java.util.Map<E,java.lang.Object> map)
Set the initial map.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E o)
Adds the specified element to this set if it is not already
present.
|
void |
clear()
Removes all of the elements from this set.
|
boolean |
contains(java.lang.Object o)
Returns true if this set contains the specified element.
|
boolean |
isEmpty()
Returns true if this set contains no elements.
|
java.util.Iterator<E> |
iterator()
Returns an iterator over the elements in this set.
|
boolean |
remove(java.lang.Object o)
Removes the specified element from this set if it is present.
|
int |
size()
Returns the number of elements in this set (its cardinality).
|
java.lang.String |
toString() |
addAll, containsAll, retainAll, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitprivate static final long serialVersionUID
private final java.util.Map<E,java.lang.Object> map
private static final java.lang.Object PRESENT
public MapDelegateSet(java.util.Map<E,java.lang.Object> map)
map - the initial mappublic java.util.Iterator<E> iterator()
iterator in interface java.lang.Iterable<E>iterator in interface java.util.Collection<E>iterator in interface java.util.Set<E>iterator in class java.util.AbstractCollection<E>ConcurrentModificationExceptionpublic int size()
public boolean isEmpty()
public boolean contains(java.lang.Object o)
public boolean add(E o)
public boolean remove(java.lang.Object o)
public void clear()
public java.lang.String toString()
toString in class java.util.AbstractCollection<E>