public class RecordingStrategiesElementLinkedList
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
private static class |
RecordingStrategiesElementLinkedList.Entry
Defines a list entry.
|
| Modifier and Type | Field and Description |
|---|---|
private static ArrayList<RecordingStrategiesElementLinkedList.Entry> |
entryPool
Stores the
RecordingStrategiesElementLinkedList.Entry pool. |
private RecordingStrategiesElementLinkedList.Entry |
header
Defines the dummy header element where to hook into further list
elements.
|
private int |
size
Stores the size of the list.
|
| Constructor and Description |
|---|
RecordingStrategiesElementLinkedList()
Constructs an empty list.
|
| Modifier and Type | Method and Description |
|---|---|
private RecordingStrategiesElementLinkedList.Entry |
addBefore(RecordingStrategiesElement value,
RecordingStrategiesElementLinkedList.Entry entry)
Adds a new entry before
entry. |
void |
addFirst(RecordingStrategiesElement value)
Inserts the specified element at the beginning of this list.
|
void |
addLast(RecordingStrategiesElement value)
Appends the specified element to the end of this list.
|
void |
clear()
Removes all of the elements from this list.
|
private static RecordingStrategiesElementLinkedList.Entry |
getEntryFromPool(RecordingStrategiesElement value,
RecordingStrategiesElementLinkedList.Entry next,
RecordingStrategiesElementLinkedList.Entry previous)
Returns an entry from the shared pool.
|
boolean |
isEmpty()
Returns whether the list is empty.
|
private static void |
releaseEntry(RecordingStrategiesElementLinkedList.Entry entry)
Releases and clears the specified
RecordingStrategiesElementLinkedList.Entry
to the shared pool. |
private RecordingStrategiesElement |
remove(RecordingStrategiesElementLinkedList.Entry entry)
Removes the given entry.
|
RecordingStrategiesElement |
removeFirst()
Removes and returns the first element from this list.
|
RecordingStrategiesElement |
removeLast()
Removes and returns the last element from this list.
|
int |
size()
Returns the number of elements in this list.
|
private static ArrayList<RecordingStrategiesElementLinkedList.Entry> entryPool
RecordingStrategiesElementLinkedList.Entry pool.private RecordingStrategiesElementLinkedList.Entry header
private int size
public RecordingStrategiesElementLinkedList()
private static final RecordingStrategiesElementLinkedList.Entry getEntryFromPool(RecordingStrategiesElement value, RecordingStrategiesElementLinkedList.Entry next, RecordingStrategiesElementLinkedList.Entry previous)
value - the value of the returned entrynext - the next entry of the returned entryprevious - the previous entry of the returned entryprivate static final void releaseEntry(RecordingStrategiesElementLinkedList.Entry entry)
RecordingStrategiesElementLinkedList.Entry
to the shared pool.entry - the RecordingStrategiesElementLinkedList.Entry to be released (must not
be null)private RecordingStrategiesElement remove(RecordingStrategiesElementLinkedList.Entry entry)
entry - the entry to be removedjava.util.NoSuchElementException - if the entry cannot be removedpublic RecordingStrategiesElement removeFirst()
java.util.NoSuchElementException - if this list is emptypublic RecordingStrategiesElement removeLast()
java.util.NoSuchElementException - if this list is emptypublic void addFirst(RecordingStrategiesElement value)
value - the element to addpublic void addLast(RecordingStrategiesElement value)
value - the element to addprivate RecordingStrategiesElementLinkedList.Entry addBefore(RecordingStrategiesElement value, RecordingStrategiesElementLinkedList.Entry entry)
entry.value - the entry valueentry - the entry to insert into beforepublic void clear()
public int size()
public boolean isEmpty()
true if it is empty, false else