T - the element typepublic final class ImmutableHashSet<T> extends ImmutableSet<T> implements Serializable
Set implementation. This implementation uses open addressing with linear probing and a table size of the nearest power of two so that load
factor is below 0.75. The implementation is inspired by Guava's ImmutableSet implementation.ImmutableSet.Builder<T>| Constructor and Description |
|---|
ImmutableHashSet(Set<T> data) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T e) |
boolean |
addAll(Collection<? extends T> c) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
boolean |
equals(Object obj) |
int |
hashCode() |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
Spliterator<T> |
spliterator() |
builder, collector, copyOf, oftoArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitparallelStream, removeIf, streampublic int size()
size in interface Collection<T>size in interface Set<T>size 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 equals(Object obj)
public int hashCode()
hashCode in interface Collection<T>hashCode in interface Set<T>hashCode in class AbstractSet<T>public boolean add(T e)
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 boolean addAll(Collection<? extends T> c)
addAll in interface Collection<T>addAll in interface Set<T>addAll in class AbstractCollection<T>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<T>retainAll in interface Set<T>retainAll in class AbstractCollection<T>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<T>removeAll in interface Set<T>removeAll in class AbstractSet<T>public void clear()
clear in interface Collection<T>clear in interface Set<T>clear in class AbstractCollection<T>public boolean isEmpty()
isEmpty in interface Collection<T>isEmpty in interface Set<T>isEmpty in class AbstractCollection<T>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<T>containsAll in interface Set<T>containsAll in class AbstractCollection<T>public Spliterator<T> spliterator()
spliterator in interface Iterable<T>spliterator in interface Collection<T>spliterator in interface Set<T>Copyright © 2015. All Rights Reserved.