A specialized double-linked list of elements that extends LinkedListEntry.
This is not a generic data structure. It only accepts elements that extend the LinkedListEntry class. See the Queue implementations for generic collections that allow constant time adding and removing at the ends.
This is not a List implementation. Despite its name, this class does not implement the List interface. It does not allow constant time lookup by index.
Because the elements themselves contain the links of this linked list, each element can be in only one list at a time. To add an element to another list, it must first be removed from its current list (if any).
In return, each element knows its own place in the linked list, as well as which list it is in. This allows constant time LinkedListEntry.addAfter, LinkedListEntry.addBefore and LinkedListEntry.unlink operations when all you have is the element.
A LinkedList
also allows constant time adding and removing at either end,
and a constant time length getter.