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 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, long notFoundId)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, long noOldIdValue)longsize()
-
Constructor Details
-
HashMapObjectId
public HashMapObjectId()
-
-
Method Details
-
New
-
New
-
size
public long size() -
isEmpty
public boolean isEmpty() -
add
-
put
-
putGet
-
get
-
getObjects
-
getIds
-
iterateObjects
-
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
-
iterateIds
-
clear
public void clear()
-