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 boolean
add(T object, long id)
void
clear()
long
get(T object)
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
size()
-
-
-
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:
optimize
in interfaceOptimizableCollection
- Returns:
- the amount of entries after the optimization is been completed.
-
iterateIds
public int iterateIds(_longProcedure procedure)
-
clear
public void clear()
-
-