Package com.tangosol.util
Class OpenHashSet<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
com.tangosol.util.OpenHashSet<E>
- Type Parameters:
 E- the type of elements that can be managed by this set
- All Implemented Interfaces:
 Iterable<E>,Collection<E>,Set<E>
An implementation of 
Set that is optimized for memory
 footprint. Specifically, instead of delegating to a HashMap
 which instantiates an "Entry" object for each element (as the HashSet does, which references those entries in a linked list
 fashion with the head of the linked list stored in the hash bucket array,
 this implementation stores its elements using an open hashing algorithm, i.e.
 the elements are stored directly in the hash bucket array.
 This implementation is explicitly NOT thread-safe.
- Since:
 - 12.2.1
 - Author:
 - cp 2013.01.15
 
- 
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.OpenHashSet(int initialCapacity) Create a OpenHashSet pre-sized to hold the specified number of elements.OpenHashSet(Collection<? extends E> coll) Create a OpenHashSet that will initially contain the contents of the passed Collection. - 
Method Summary
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAllMethods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, retainAll, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Set
addAll, containsAll, isEmpty, retainAll, spliterator 
- 
Constructor Details
- 
OpenHashSet
public OpenHashSet()Default constructor. - 
OpenHashSet
public OpenHashSet(int initialCapacity) Create a OpenHashSet pre-sized to hold the specified number of elements.- Parameters:
 initialCapacity- the initial capacity requirement for the hash set
 - 
OpenHashSet
Create a OpenHashSet that will initially contain the contents of the passed Collection. In other words, this is a "copy constructor".- Parameters:
 coll- the Collection whose contents this
 
 - 
 - 
Method Details
- 
size
public int size()- Specified by:
 sizein interfaceCollection<E>- Specified by:
 sizein interfaceSet<E>- Specified by:
 sizein classAbstractCollection<E>
 - 
contains
- Specified by:
 containsin interfaceCollection<E>- Specified by:
 containsin interfaceSet<E>- Overrides:
 containsin classAbstractCollection<E>
 - 
add
- Specified by:
 addin interfaceCollection<E>- Specified by:
 addin interfaceSet<E>- Overrides:
 addin classAbstractCollection<E>
 - 
remove
- Specified by:
 removein interfaceCollection<E>- Specified by:
 removein interfaceSet<E>- Overrides:
 removein classAbstractCollection<E>
 - 
clear
public void clear()- Specified by:
 clearin interfaceCollection<E>- Specified by:
 clearin interfaceSet<E>- Overrides:
 clearin classAbstractCollection<E>
 - 
iterator
 - 
toArray
- Specified by:
 toArrayin interfaceCollection<E>- Specified by:
 toArrayin interfaceSet<E>- Overrides:
 toArrayin classAbstractCollection<E>
 - 
toArray
public <T> T[] toArray(T[] a) - Specified by:
 toArrayin interfaceCollection<E>- Specified by:
 toArrayin interfaceSet<E>- Overrides:
 toArrayin classAbstractCollection<E>
 - 
getElement
Expose the indexed element storage to sub-classes in a range-unsafe manner.- Parameters:
 n- an element index- Returns:
 - the value stored at the specified index; note that a null value is not differentiable from an empty element, since both are returned as null
 
 
 -