net.ranides.assira.collection.list
Class AbstractListIterator<T>

java.lang.Object
  extended by net.ranides.assira.collection.list.AbstractListIterator<T>
Type Parameters:
T -
All Implemented Interfaces:
Iterator<T>, ListIterator<T>
Direct Known Subclasses:
ImmutableListIterator

public abstract class AbstractListIterator<T>
extends Object
implements ListIterator<T>

Klasa abstrakcyjna wygodna do implementowania iteratora przeglądającego obiekt o strukturze listo-podobnej. Szczególnie wygodna przy pisaniu delegatorów, które nie muszą koncentrować się na implementacji logiki iteratora.

Author:
ranides

Constructor Summary
AbstractListIterator()
          Tworzy iterator wskazujący na pierwszą pozycję w liście
AbstractListIterator(int index)
          Tworzy iterator wskazujący na podaną pozycję w liście
 
Method Summary
 void add(T value)
           
 boolean hasNext()
           
 boolean hasPrevious()
           
 T next()
           
 int nextIndex()
           
 T previous()
           
 int previousIndex()
           
 void remove()
           
 void set(T value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractListIterator

public AbstractListIterator()
Tworzy iterator wskazujący na pierwszą pozycję w liście


AbstractListIterator

public AbstractListIterator(int index)
Tworzy iterator wskazujący na podaną pozycję w liście

Parameters:
index -
Method Detail

set

public final void set(T value)
Specified by:
set in interface ListIterator<T>

add

public final void add(T value)
Specified by:
add in interface ListIterator<T>

remove

public final void remove()
Specified by:
remove in interface Iterator<T>
Specified by:
remove in interface ListIterator<T>

hasNext

public final boolean hasNext()
Specified by:
hasNext in interface Iterator<T>
Specified by:
hasNext in interface ListIterator<T>

next

public final T next()
Specified by:
next in interface Iterator<T>
Specified by:
next in interface ListIterator<T>

hasPrevious

public final boolean hasPrevious()
Specified by:
hasPrevious in interface ListIterator<T>

previous

public final T previous()
Specified by:
previous in interface ListIterator<T>

nextIndex

public final int nextIndex()
Specified by:
nextIndex in interface ListIterator<T>

previousIndex

public final int previousIndex()
Specified by:
previousIndex in interface ListIterator<T>


Copyright © 2013. All Rights Reserved.