public class OneWayLinkedList
extends java.lang.Object
A class that implements a (one-way) linked list.
Unlike STL, our implementation stores only one
Element per element.
Also, a move_to_front operation is implemented.
(In STL we need to erase and then push_front the element,
so data is copied and Elements to it may become invalid.
Our implementation doesn't copy data. move_to_front
operates only with Elements.)
Use TemporaryIterator instead of iterator.
(Each TemporaryIterator stores a Element to the previous
list element, so, after erasing or moving element after
that previous, TemporaryIterator
may point to another element. But all operations
with iterators are like in STL, i.e.,
begin() points to the first data item.
If you want a permanent
Element to element, use Element (e.g., &*it where it is
a TemporaryIterator) that points to the same
data item even when element was moved to front using
move_to_front operation.)
Author: Sergejs Kozlovics (in LaTeX: Sergejs Kozlovi\v{c}s)
Last modified: 31.08.2006. 16:15.