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 Sized, OptimizableCollection, Composition
Primitive (read: fast) synchronized pseudo map implementation that maps long id values to weakly referenced objects.
-
-
Constructor Summary
Constructors Constructor Description HashMapIdObject()
-
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 Detail
-
New
public static final <T> HashMapIdObject<T> New()
-
New
public static final <T> HashMapIdObject<T> New(int initialSlotLength)
-
add
public final boolean add(long id, E object)
-
put
public final boolean put(long id, E object)
-
get
public final E get(long id)
-
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.
-
iterateIds
public final int iterateIds(_longProcedure procedure)
-
clear
public final void clear()
-
-