Package one.microstream.collections.lazy
Class LazyHashSet<T>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<T>
one.microstream.collections.lazy.LazyHashSet<T>
- Type Parameters:
T- Type of contained elements
- All Implemented Interfaces:
Iterable<T>,Collection<T>,Set<T>
public final class LazyHashSet<T> extends AbstractSet<T>
Implementation of the
Set interface, backed by a LazyHashMap-
Constructor Summary
Constructors Constructor Description LazyHashSet()Create a new LazyHashSet instance with default maximal segment size.LazyHashSet(int maxSegmentSize)Creates a newLazyHashSetwith a custom segment size.LazyHashSet(int maxSegmentSize, LazySegmentUnloader lazySegmentUnloader)Creates a newLazyHashSetwith a maximum desired segment size. -
Method Summary
Modifier and Type Method Description booleanadd(T e)voidclear()booleancontains(Object o)intgetMaxSegmentSize()Returns the maximum segment size of thisLazyArrayList.longgetSegmentCount()Returns the current number of internal segments.booleanisEmpty()Iterator<T>iterator()booleanremove(Object o)Iterable<? extends LazyHashMap.Segment<?>>segments()Returns an Iterable over the Segment in this list.intsize()Spliterator<T>spliterator()StringtoString()Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray
-
Constructor Details
-
LazyHashSet
public LazyHashSet()Create a new LazyHashSet instance with default maximal segment size. -
LazyHashSet
public LazyHashSet(int maxSegmentSize)Creates a newLazyHashSetwith a custom segment size. The desired maximum segment size is not a hard limit. The map may exceed that limit.- Parameters:
maxSegmentSize- maximum desired segment size, must be non negative.
-
LazyHashSet
Creates a newLazyHashSetwith a maximum desired segment size. The desired maximum segment size is not a hard limit. The map may exceed that limit.- Parameters:
maxSegmentSize- maximum desired segment size, must be non negative.lazySegmentUnloader- LazySegmentUnloader instance
-
-
Method Details
-
getSegmentCount
public long getSegmentCount()Returns the current number of internal segments.- Returns:
- the current number of internal segments.
-
segments
Returns an Iterable over the Segment in this list.- Returns:
- an Iterable over the Segment in this list
-
getMaxSegmentSize
public int getMaxSegmentSize()Returns the maximum segment size of thisLazyArrayList.- Returns:
- the maximum segment size of this
LazyArrayList
-
iterator
-
size
public int size()- Specified by:
sizein interfaceCollection<T>- Specified by:
sizein interfaceSet<T>- Specified by:
sizein classAbstractCollection<T>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<T>- Specified by:
isEmptyin interfaceSet<T>- Overrides:
isEmptyin classAbstractCollection<T>
-
contains
- Specified by:
containsin interfaceCollection<T>- Specified by:
containsin interfaceSet<T>- Overrides:
containsin classAbstractCollection<T>
-
add
- Specified by:
addin interfaceCollection<T>- Specified by:
addin interfaceSet<T>- Overrides:
addin classAbstractCollection<T>
-
remove
- Specified by:
removein interfaceCollection<T>- Specified by:
removein interfaceSet<T>- Overrides:
removein classAbstractCollection<T>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<T>- Specified by:
clearin interfaceSet<T>- Overrides:
clearin classAbstractCollection<T>
-
spliterator
-
toString
- Overrides:
toStringin classAbstractCollection<T>
-