Package ghidra.util.datastruct
Class IntIndexManager
- java.lang.Object
-
- ghidra.util.datastruct.IntIndexManager
-
- All Implemented Interfaces:
java.io.Serializable
public class IntIndexManager extends java.lang.Object implements java.io.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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IntIndexManager()
Constructs an IntIndexManager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
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.
-
-
-
Method Detail
-
allocate
public int allocate()
Returns the smallest unused index value.- Throws:
java.lang.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.
-
-