public class IdentityHashSet<T> extends AbstractSet<T> implements Set<T>, Cloneable, Serializable
IdentityComparator,
Serialized Form| Constructor and Description |
|---|
IdentityHashSet()
Constructs a new, empty set; the backing IdentityHashMap
instance has default capacity (32).
|
IdentityHashSet(Collection<T> c)
Constructs a new set containing the elements in the specified
collection.
|
IdentityHashSet(int expectedMaxSize)
Constructs a new, empty set with the specified expected maximum size.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T o) |
void |
clear() |
Object |
clone() |
boolean |
contains(Object o) |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
boolean |
remove(Object o) |
int |
size() |
equals, hashCode, removeAlladdAll, containsAll, retainAll, toArray, toArray, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitaddAll, containsAll, equals, hashCode, removeAll, retainAll, spliterator, toArray, toArrayparallelStream, removeIf, streampublic IdentityHashSet()
public IdentityHashSet(Collection<T> c)
c - the collection whose elements are to be placed into this set.NullPointerException - if the specified collection is null.public IdentityHashSet(int expectedMaxSize)
expectedMaxSize - the expected maximum size of the map.IllegalArgumentException - if expectedMaxSize is negativepublic int size()
size in interface Collection<T>size in interface Set<T>size in class AbstractCollection<T>public boolean isEmpty()
isEmpty in interface Collection<T>isEmpty in interface Set<T>isEmpty in class AbstractCollection<T>public boolean contains(Object o)
contains in interface Collection<T>contains in interface Set<T>contains in class AbstractCollection<T>public boolean add(T o)
add in interface Collection<T>add in interface Set<T>add in class AbstractCollection<T>public boolean remove(Object o)
remove in interface Collection<T>remove in interface Set<T>remove in class AbstractCollection<T>public void clear()
clear in interface Collection<T>clear in interface Set<T>clear in class AbstractCollection<T>Copyright © 2018. All rights reserved.