public class AllocationFreeList<T extends AllocationFreeList.Element<T>> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AllocationFreeList.Element<T extends AllocationFreeList.Element<T>>
An element of a AllocationFreeList has slots for the next element in the list, so
singly-linked lists can be assembled without allocation.
|
static class |
AllocationFreeList.PreviouslyRegisteredElementException |
Modifier | Constructor and Description |
---|---|
protected |
AllocationFreeList()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static <U extends AllocationFreeList.Element<U>> |
factory() |
T |
getFirst()
Get the first enabled element of the list as a T.
|
Object |
getFirstObject()
For detecting errors: Get the first element as an Object so there is no type checking.
|
void |
prepend(T element)
Prepend an element to the list.
|
void |
scrub()
Remove any disabled elements from the list.
|
T |
testingBackDoorGetFirst()
For testing, to iterate without scrubbing.
|
public static <U extends AllocationFreeList.Element<U>> AllocationFreeList<U> factory()
public T getFirst()
public Object getFirstObject()
public void prepend(T element)
public void scrub()
public T testingBackDoorGetFirst()