|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.omnaest.utils.structure.iterator.IteratorDecoratorSwitchable<E>
public class IteratorDecoratorSwitchable<E>
This is a switchable Iterator decorator, which holds a List of Iterator instances which it can address.
Per default the first available Iterator instance is active.
switchTo(int)| Field Summary | |
|---|---|
protected int |
currentActiveIteratorIndexPosition
|
protected List<Iterator<E>> |
iteratorList
|
| Constructor Summary | |
|---|---|
IteratorDecoratorSwitchable(Iterable<Iterator<E>> iteratorList)
|
|
IteratorDecoratorSwitchable(Iterator<E>... iterators)
|
|
| Method Summary | |
|---|---|
Iterator<E> |
getActiveIterator()
Returns the currently active Iterator instance or null, if no instance is active. |
List<Iterator<E>> |
getIteratorList()
|
boolean |
hasActiveIterator()
Returns true, if there is an active Iterator instance set |
boolean |
hasNext()
|
E |
next()
|
void |
remove()
|
IteratorDecoratorSwitchable<E> |
switchTo(int iteratorIndexPosition)
Switches to the Iterator instance which has the given iterator index position within the getIteratorList() |
IteratorDecoratorSwitchable<E> |
switchTo(Iterator<E> iterator)
Similar to switchTo(int) but resolving the right Iterator instance using the given Iterator. |
IteratorDecoratorSwitchable<E> |
switchToNext()
Switches the active Iterator to the next Iterator |
IteratorDecoratorSwitchable<E> |
switchToNextIteratorWhichHasNext()
Switches to the next Iterator instance which returns true for Iterator.hasNext(), but only if the
getActiveIterator() does not return true for Iterator.hasNext() itself already. |
IteratorDecoratorSwitchable<E> |
switchToPrevious()
Switches the active Iterator to the previous Iterator |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final List<Iterator<E>> iteratorList
protected int currentActiveIteratorIndexPosition
| Constructor Detail |
|---|
public IteratorDecoratorSwitchable(Iterable<Iterator<E>> iteratorList)
iteratorList - IteratorDecoratorSwitchablepublic IteratorDecoratorSwitchable(Iterator<E>... iterators)
| Method Detail |
|---|
public boolean hasNext()
hasNext in interface Iterator<E>public E next()
next in interface Iterator<E>public void remove()
remove in interface Iterator<E>public Iterator<E> getActiveIterator()
Iterator instance or null, if no instance is active.
public IteratorDecoratorSwitchable<E> switchTo(int iteratorIndexPosition)
Iterator instance which has the given iterator index position within the getIteratorList()
iteratorIndexPosition -
public IteratorDecoratorSwitchable<E> switchTo(Iterator<E> iterator)
switchTo(int) but resolving the right Iterator instance using the given Iterator. This
means if the given Iterator instance is not contained within the internal list, it will not be activated.
iterator -
getIteratorList()public IteratorDecoratorSwitchable<E> switchToNext()
Iterator to the next Iterator
public IteratorDecoratorSwitchable<E> switchToPrevious()
Iterator to the previous Iterator
public IteratorDecoratorSwitchable<E> switchToNextIteratorWhichHasNext()
Iterator instance which returns true for Iterator.hasNext(), but only if the
getActiveIterator() does not return true for Iterator.hasNext() itself already.
public boolean hasActiveIterator()
Iterator instance set
public List<Iterator<E>> getIteratorList()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||