|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.omnaest.utils.structure.iterator.ListIteratorDecoratorSwitchable<E>
public class ListIteratorDecoratorSwitchable<E>
This is a switchable ListIterator decorator, which holds a List of ListIterator instances which it can
address. Per default the first available ListIterator instance is active.
| Field Summary | |
|---|---|
protected int |
currentActiveListIteratorIndexPosition
|
protected List<ListIterator<E>> |
listIteratorList
|
| Constructor Summary | |
|---|---|
ListIteratorDecoratorSwitchable(Iterable<ListIterator<E>> iteratorList)
|
|
ListIteratorDecoratorSwitchable(ListIterator<E>... iterators)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final List<ListIterator<E>> listIteratorList
protected int currentActiveListIteratorIndexPosition
| Constructor Detail |
|---|
public ListIteratorDecoratorSwitchable(Iterable<ListIterator<E>> iteratorList)
iteratorList - ListIteratorDecoratorSwitchablepublic ListIteratorDecoratorSwitchable(ListIterator<E>... iterators)
| Method Detail |
|---|
public boolean hasNext()
hasNext in interface Iterator<E>hasNext in interface ListIterator<E>public E next()
next in interface Iterator<E>next in interface ListIterator<E>public boolean hasPrevious()
hasPrevious in interface ListIterator<E>public E previous()
previous in interface ListIterator<E>public int nextIndex()
nextIndex in interface ListIterator<E>public int previousIndex()
previousIndex in interface ListIterator<E>public void remove()
remove in interface Iterator<E>remove in interface ListIterator<E>public void set(E e)
set in interface ListIterator<E>public void add(E e)
add in interface ListIterator<E>public ListIterator<E> getActiveListIterator()
ListIterator instance or null, if no instance is active.
public ListIteratorDecoratorSwitchable<E> switchTo(int listIteratorIndexPosition)
ListIterator instance which has the given list iterator index position within the
getListIteratorList()
listIteratorIndexPosition -
public ListIteratorDecoratorSwitchable<E> switchTo(ListIterator<E> listIterator)
switchTo(int) but resolving the right ListIterator instance using the given ListIterator.
This means if the given ListIterator instance is not contained within the internal List, it will not be
activated.
listIterator -
getListIteratorList()public ListIteratorDecoratorSwitchable<E> switchToNext()
ListIterator to the next ListIterator
public ListIteratorDecoratorSwitchable<E> switchToPrevious()
ListIterator to the previous ListIterator
public ListIteratorDecoratorSwitchable<E> switchToNextIteratorWhichHasNext()
ListIterator instance which returns true for ListIterator.hasNext(), but only if the
getActiveListIterator() does not return true for ListIterator.hasNext() itself already.
public ListIteratorDecoratorSwitchable<E> switchToPreviousIteratorWhichHasPrevious()
ListIterator instance which returns true for ListIterator.hasNext(), but only if the
getActiveListIterator() does not return true for ListIterator.hasNext() itself already.
public boolean hasPreviousListIteratorToSwitchTo()
switchToPrevious() will find another active ListIterator
public boolean hasNextListIteratorToSwitchTo()
switchToNext() will find another active ListIterator
public boolean hasActiveListIterator()
Iterator instance set
public List<ListIterator<E>> getListIteratorList()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||