Class FixedListIterator

java.lang.Object
ch.tocco.nice2.conditionals.api.tree.util.FixedListIterator
All Implemented Interfaces:
Iterator<Node>, ListIterator<Node>

public class FixedListIterator extends Object implements ListIterator<Node>
A list iterator for fixed-length lists that are a list-representation of fields. An example of such a list can be found in EquationNode: ```java assert equationNode.get(0) == equationNode.getLeft(); assert equationNode.get(1) == equationNode.getRight(); ``` Because the lists are of fixed length, this iterator can keep a consistent state and behaviour even if the list is modified during iteration. It therefore doesn't throw any ConcurrentModificationExceptions. Also, for the same reason, it doesn't support the ListIterator.add(Object) and ListIterator.remove() operations. It *does* support ListIterator.set(Object), however.