|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<E>
jodd.util.collection.SetMapAdapter<E>
public abstract class SetMapAdapter<E>
Map adapter for a set provides an easy way to have a Set from various map implementations.
| Field Summary | |
|---|---|
protected java.util.Map<E,java.lang.Object> |
map
|
| Constructor Summary | |
|---|---|
protected |
SetMapAdapter(java.util.Map<E,java.lang.Object> mapImplementation)
Constructs a new, empty set; the backing HashMap instance has
default initial capacity (16) and load factor (0.75). |
| Method Summary | |
|---|---|
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). |
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, containsAll, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
addAll, containsAll, retainAll, toArray, toArray |
| Field Detail |
|---|
protected java.util.Map<E,java.lang.Object> map
| Constructor Detail |
|---|
protected SetMapAdapter(java.util.Map<E,java.lang.Object> mapImplementation)
HashMap instance has
default initial capacity (16) and load factor (0.75).
| Method Detail |
|---|
public 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>public int size()
size in interface java.util.Collection<E>size in interface java.util.Set<E>size in class java.util.AbstractCollection<E>public boolean isEmpty()
true if this set contains no elements.
isEmpty in interface java.util.Collection<E>isEmpty in interface java.util.Set<E>isEmpty in class java.util.AbstractCollection<E>public boolean contains(java.lang.Object o)
true if this set contains the specified element.
contains in interface java.util.Collection<E>contains in interface java.util.Set<E>contains in class java.util.AbstractCollection<E>o - element whose presence in this set is to be tested.
true if this set contains the specified element.public boolean add(E o)
add in interface java.util.Collection<E>add in interface java.util.Set<E>add in class java.util.AbstractCollection<E>o - element to be added to this set.
true if the set did not already contain the specified
element.public boolean remove(java.lang.Object o)
remove in interface java.util.Collection<E>remove in interface java.util.Set<E>remove in class java.util.AbstractCollection<E>o - object to be removed from this set, if present.
true if the set contained the specified element.public void clear()
clear in interface java.util.Collection<E>clear in interface java.util.Set<E>clear in class java.util.AbstractCollection<E>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||