T - the type of elements stored.public class _Private_RecyclingQueue<T>
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
_Private_RecyclingQueue.ElementFactory<T>
Factory for new queue elements.
|
static interface |
_Private_RecyclingQueue.Recycler<T> |
| Constructor and Description |
|---|
_Private_RecyclingQueue(int initialCapacity,
_Private_RecyclingQueue.ElementFactory<T> elementFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Reset the index and make the queue reusable.
|
T |
get(int index) |
boolean |
isEmpty() |
java.util.Iterator<T> |
iterate() |
int |
push(_Private_RecyclingQueue.Recycler<T> recycler)
Pushes an element onto the top of the queue, instantiating a new element only if the queue has not
previously grown to the new depth.
|
void |
remove()
Reclaim the current element.
|
int |
size() |
void |
truncate(int index) |
public _Private_RecyclingQueue(int initialCapacity,
_Private_RecyclingQueue.ElementFactory<T> elementFactory)
initialCapacity - the initial capacity of the underlying collection.elementFactory - the factory used to create a new element on #push() when the queue has
not previously grown to the new depth.public void truncate(int index)
public T get(int index)
public int push(_Private_RecyclingQueue.Recycler<T> recycler)
public void remove()
public java.util.Iterator<T> iterate()
public boolean isEmpty()
public void clear()
public int size()