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 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 boolean
add(long id, E object)
void
clear()
E
get(long id)
XList<Long>
getIds()
XList<E>
getObjects()
boolean
isEmpty()
int
iterate(Consumer<? super KeyValue<Long,E>> procedure)
int
iterateIds(_longProcedure procedure)
int
iterateKeys(Consumer<? super Long> procedure)
int
iterateValues(Consumer<? super E> procedure)
static <T> HashMapIdObject<T>
New()
static <T> HashMapIdObject<T>
New(int initialSlotLength)
long
optimize()
Optimizes the internal storage and returns the remaining amount of entries.boolean
put(long id, E object)
E
putGet(long id, E object)
long
size()
String
toString()
-
Constructor Details
-
HashMapIdObject
public HashMapIdObject()
-
-
Method Details
-
New
-
New
-
size
public final long size() -
isEmpty
public final boolean isEmpty() -
add
-
put
-
putGet
-
get
-
getObjects
-
getIds
-
iterateValues
-
toString
-
optimize
public final 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.
-
iterateKeys
-
iterateIds
-
iterate
-
clear
public final void clear()
-