Package org.apache.ignite.internal.util
Class GridHandleTable
- java.lang.Object
-
- org.apache.ignite.internal.util.GridHandleTable
-
public class GridHandleTable extends Object
Lightweight identity hash table which maps objects to integer handles, assigned in ascending order.
-
-
Constructor Summary
Constructors Constructor Description GridHandleTable(int initCap, float loadFactor)Creates new HandleTable with given capacity and load factor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Resets table to its initial (empty) state.Object[]objects()intputIfAbsent(Object obj)Looks up and returns handle associated with the given object.
-
-
-
Method Detail
-
putIfAbsent
public int putIfAbsent(Object obj)
Looks up and returns handle associated with the given object. If the given object was not found, puts it into the table and returns-1.- Parameters:
obj- Object.- Returns:
- Object's handle or
-1if it was not in the table.
-
clear
public void clear()
Resets table to its initial (empty) state.
-
objects
public Object[] objects()
- Returns:
- Returns objects that were added to handles table.
-
-