Java Reference
In-Depth Information
Instead, the Java library supplies a ListIterator type. A list iterator encapsulates
a position anywhere inside the linked list (see Figure 2 ).
Figure 2
A List Iterator
667
668
Figure 3
A Conceptual View of the List Iterator
Conceptually, you should think of the iterator as pointing between two elements, just
as the cursor in a word processor points between two characters (see Figure 3 ). In the
conceptual view, think of each element as being like a letter in a word processor, and
think of the iterator as being like the blinking cursor between letters.
You obtain a list iterator with the listIterator method of the LinkedList
class:
Search WWH ::




Custom Search