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 boolean
add(T object, long id)
void
clear()
long
get(T object, long notFoundId)
XList<Long>
getIds()
XList<T>
getObjects()
boolean
isEmpty()
int
iterateIds(Consumer<? super Long> procedure)
int
iterateIds(_longProcedure procedure)
int
iterateObjects(Consumer<? super T> procedure)
static <T> HashMapObjectId<T>
New()
static <T> HashMapObjectId<T>
New(int initialSlotLength)
long
optimize()
Optimizes the internal storage and returns the remaining amount of entries.boolean
put(T object, long id)
long
putGet(T object, long id, long noOldIdValue)
long
size()
-
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:
optimize
in interfaceOptimizableCollection
- Returns:
- the amount of entries after the optimization is been completed.
-
iterateIds
-
iterateIds
-
clear
public void clear()
-