Package ghidra.util.datastruct
Class IntIndexManager
java.lang.Object
ghidra.util.datastruct.IntIndexManager
- All Implemented Interfaces:
Serializable
Class to generate int indexes to be used for arrays or tables. If a location
or entry in a table becomes available, the index for that location is released.
This class manages the use and reuse of those indexes.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
allocate()
Returns the smallest unused index value.void
clear()
frees all index values.void
deallocate
(int index) Returns the index value so that it can be reused.
-
Constructor Details
-
IntIndexManager
public IntIndexManager()Constructs an IntIndexManager.
-
-
Method Details
-
allocate
public int allocate()Returns the smallest unused index value.- Throws:
IndexOutOfBoundsException
- thrown if there are no unused indexes.
-
deallocate
public void deallocate(int index) Returns the index value so that it can be reused.- Parameters:
index
- the index to be free'd for reuse.
-
clear
public void clear()frees all index values.
-