public class IdentityHashSet<T> extends AbstractSet<T> implements Set<T>
A Set implementation based on reference (not object) equality. This
is an intentional violation of the Set.equals(Object) contract for specialized
purposes. Uses a backing instance of IdentityHashMap.
| Constructor and Description |
|---|
IdentityHashSet() |
IdentityHashSet(Collection<? extends T> c) |
IdentityHashSet(int expectedMaxSize) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T o) |
void |
clear() |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
int |
size() |
equals, hashCodeaddAll, contains, containsAll, retainAll, toArray, toArray, toStringpublic IdentityHashSet()
public IdentityHashSet(int expectedMaxSize)
public IdentityHashSet(Collection<? extends T> c)
public boolean add(T o)
add in interface Collection<T>add in interface Set<T>add in class AbstractCollection<T>Set.add(Object)public void clear()
clear in interface Collection<T>clear in interface Set<T>clear in class AbstractCollection<T>Set.clear()public boolean isEmpty()
isEmpty in interface Collection<T>isEmpty in interface Set<T>isEmpty in class AbstractCollection<T>Set.isEmpty()public Iterator<T> iterator()
iterator in interface Iterable<T>iterator in interface Collection<T>iterator in interface Set<T>iterator in class AbstractCollection<T>Set.iterator()public boolean remove(Object o)
remove in interface Collection<T>remove in interface Set<T>remove in class AbstractCollection<T>Set.remove(Object)public boolean removeAll(Collection<?> c)
removeAll in interface Collection<T>removeAll in interface Set<T>removeAll in class AbstractSet<T>Set.removeAll(java.util.Collection)public int size()
size in interface Collection<T>size in interface Set<T>size in class AbstractCollection<T>Set.size()Copyright © 2014. All rights reserved.