Package one.microstream.collections
Class HashMapObjectId<T>
- java.lang.Object
-
- one.microstream.collections.HashMapObjectId<T>
-
- All Implemented Interfaces:
OptimizableCollection,Sized,IdentityEqualityLogic,Composition
public final class HashMapObjectId<T> extends Object implements Sized, OptimizableCollection, Composition, IdentityEqualityLogic
Primitive (read: fast) synchronized pseudo map implementation that maps long id values to weakly referenced objects.
-
-
Constructor Summary
Constructors Constructor Description HashMapObjectId()
-
Method Summary
Modifier and Type Method Description booleanadd(T object, long id)voidclear()longget(T object)XList<Long>getIds()XList<T>getObjects()booleanisEmpty()intiterateIds(Consumer<? super Long> procedure)intiterateIds(_longProcedure procedure)intiterateObjects(Consumer<? super T> procedure)static <T> HashMapObjectId<T>New()static <T> HashMapObjectId<T>New(int initialSlotLength)longoptimize()Optimizes the internal storage and returns the remaining amount of entries.booleanput(T object, long id)longputGet(T object, long id)longsize()
-
-
-
Method Detail
-
New
public static final <T> HashMapObjectId<T> New()
-
New
public static final <T> HashMapObjectId<T> New(int initialSlotLength)
-
add
public boolean add(T object, long id)
-
put
public boolean put(T object, long id)
-
putGet
public long putGet(T object, long id)
-
get
public long get(T object)
-
optimize
public 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 int iterateIds(_longProcedure procedure)
-
clear
public void clear()
-
-