jmce.util
Class FastLinkedList<T>
java.lang.Object
jmce.util.FastLinkedList<T>
public class FastLinkedList<T>
- extends java.lang.Object
Fast double linked list
This class implements a generic double linked list very fast because
the link removed from the list are inserted in one ring buffer and
insertion of one new element normally do not require to create a new
link if one already used is present in the ring buffer.
To iterate
the list be carefully to remove element because the pointer are
destroyed so the next element must be saved BEFORE REMOVING the link
from the list.
- Since:
- 1.02
- Author:
- Mario Viara
Nested Class Summary |
static class |
FastLinkedList.Node<T>
Inner class to hold a link and the element. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FastLinkedList
public FastLinkedList()
remove
public void remove(FastLinkedList.Node<T> e)
- Remove one element
addToBegin
public final void addToBegin(T element)
addToEnd
public final void addToEnd(T element)
getHead
public final FastLinkedList.Node<T> getHead()
getFirst
public final FastLinkedList.Node<T> getFirst()
getLast
public final FastLinkedList.Node<T> getLast()
isHead
public final boolean isHead(FastLinkedList.Node<T> l)
getSize
public final int getSize()
search
public final FastLinkedList.Node<T> search(T element)