public final class ObjectHashSet<T>
extends java.lang.Object
implements java.util.Set<T>
ObjectIterator,
Set| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_INITIAL_CAPACITY
The initial capacity used when none is specified in the constructor.
|
static float |
DEFAULT_LOAD_FACTOR
The load factor used when none is specified in the constructor.
|
| Constructor and Description |
|---|
ObjectHashSet() |
ObjectHashSet(int proposedCapacity) |
ObjectHashSet(int initialCapacity,
float loadFactor) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T value) |
boolean |
addAll(java.util.Collection<? extends T> coll) |
int |
capacity()
Get the total capacity for the set to which the load factor with be a fraction of.
|
void |
clear() |
void |
compact()
Compact the backing arrays by rehashing with a capacity just larger than current size
and giving consideration to the load factor.
|
boolean |
contains(java.lang.Object value) |
boolean |
containsAll(java.util.Collection<?> coll) |
void |
copy(ObjectHashSet<T> that) |
ObjectHashSet<T> |
difference(ObjectHashSet<T> other)
Fast Path set difference for comparison with another ObjectHashSet.
|
boolean |
equals(java.lang.Object other) |
int |
hashCode() |
boolean |
isEmpty() |
ObjectIterator<T> |
iterator() |
float |
loadFactor()
Get the load factor beyond which the set will increase size.
|
boolean |
remove(java.lang.Object value) |
boolean |
removeAll(java.util.Collection<?> coll) |
void |
resizeNotifier(java.util.function.IntConsumer resizeNotifier)
Add a Consumer that will be called when the collection is resized.
|
boolean |
retainAll(java.util.Collection<?> coll) |
int |
size() |
java.lang.Object[] |
toArray() |
<T1> T1[] |
toArray(T1[] into) |
java.lang.String |
toString() |
public static final float DEFAULT_LOAD_FACTOR
public static final int DEFAULT_INITIAL_CAPACITY
public ObjectHashSet()
public ObjectHashSet(int proposedCapacity)
public ObjectHashSet(int initialCapacity,
float loadFactor)
public void resizeNotifier(java.util.function.IntConsumer resizeNotifier)
resizeNotifier - IntConsumer containing the new resizeThresholdpublic boolean add(T value)
public boolean remove(java.lang.Object value)
public void compact()
public boolean contains(java.lang.Object value)
public int size()
public boolean isEmpty()
public float loadFactor()
public int capacity()
public void clear()
public boolean containsAll(java.util.Collection<?> coll)
public boolean addAll(java.util.Collection<? extends T> coll)
public ObjectHashSet<T> difference(ObjectHashSet<T> other)
NB: garbage free in the identical case, allocates otherwise.
other - the other set to subtractpublic boolean removeAll(java.util.Collection<?> coll)
public ObjectIterator<T> iterator()
public void copy(ObjectHashSet<T> that)
public java.lang.String toString()
toString in class java.lang.Objectpublic <T1> T1[] toArray(T1[] into)
public java.lang.Object[] toArray()
public boolean equals(java.lang.Object other)
public int hashCode()
Copyright © 2014 - 2016 Real Logic Ltd. All Rights Reserved.