Package one.microstream.collections
Class HashMapIdObject<E>
java.lang.Object
one.microstream.collections.HashMapIdObject<E>
- All Implemented Interfaces:
OptimizableCollection,Sized,Composition
public final class HashMapIdObject<E> extends Object implements OptimizableCollection, Composition
Primitive (read: fast) synchronized pseudo map implementation that maps long id values to weakly referenced objects.
-
Method Summary
Modifier and Type Method Description booleanadd(long id, E object)voidclear()Eget(long id)XList<Long>getIds()XList<E>getObjects()booleanisEmpty()intiterate(Consumer<? super KeyValue<Long,E>> procedure)intiterateIds(_longProcedure procedure)intiterateKeys(Consumer<? super Long> procedure)intiterateValues(Consumer<? super E> procedure)static <T> HashMapIdObject<T>New()static <T> HashMapIdObject<T>New(int initialSlotLength)longoptimize()Optimizes the internal storage and returns the remaining amount of entries.booleanput(long id, E object)EputGet(long id, E object)longsize()StringtoString()
-
Method Details
-
New
-
New
-
size
public final long size() -
isEmpty
public final boolean isEmpty() -
add
-
put
-
putGet
-
get
-
getObjects
-
getIds
-
iterateValues
-
toString
-
optimize
public final long optimize()Optimizes the internal storage and returns the remaining amount of entries.- Specified by:
optimizein interfaceOptimizableCollection- Returns:
- the amount of entries after the optimization is been completed.
-
iterateKeys
-
iterateIds
-
iterate
-
clear
public final void clear()
-