|
TUM CCSM Commons | |||||||||
| 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>
edu.tum.cs.commons.collections.IdentityHashSet<E>
public class IdentityHashSet<E>
This class implements a set based on referential equality similar to JDK
class IdentityHashMap. This class can be e.g. used to implement
listener lists that should not rely on the listeners equals()-methods.
The implementation is based on class HashSet that also uses
an underlying hash map.
| Constructor Summary | |
|---|---|
IdentityHashSet()
Create new identity hash set. |
|
IdentityHashSet(Collection<? extends E> collection)
Create new identity hash set from an existing collection. |
|
IdentityHashSet(int expectedMaxSize)
Create new identity hash set with an expected maximum size. |
|
| 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. |
IdentityHashSet<E> |
clone()
Returns a shallow copy of this IdentityHashSet instance: the elements themselves are not cloned. |
boolean |
contains(Object o)
Returns true if this set contains the specified element. |
boolean |
isEmpty()
Returns true if this set contains no elements. |
Iterator<E> |
iterator()
Return iterator over the set. |
boolean |
remove(Object o)
Removes the specified element from this set if it is present. |
int |
size()
Get set size. |
| 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 |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
addAll, containsAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public IdentityHashSet()
public IdentityHashSet(Collection<? extends E> collection)
public IdentityHashSet(int expectedMaxSize)
| Method Detail |
|---|
public boolean add(E o)
add in interface Collection<E>add in interface Set<E>add in class AbstractCollection<E>o - element to be added to this set.
public void clear()
clear in interface Collection<E>clear in interface Set<E>clear in class AbstractCollection<E>public IdentityHashSet<E> clone()
clone in class Objectpublic boolean contains(Object o)
contains in interface Collection<E>contains in interface Set<E>contains in class AbstractCollection<E>o - element whose presence in this set is to be tested.
public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in interface Set<E>isEmpty in class AbstractCollection<E>public Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in interface Set<E>iterator in class AbstractCollection<E>public boolean remove(Object o)
remove in interface Collection<E>remove in interface Set<E>remove in class AbstractCollection<E>o - object to be removed from this set, if present.
public int size()
size in interface Collection<E>size in interface Set<E>size in class AbstractCollection<E>
|
TUM CCSM Commons | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||