protected static class PowerSet.AddElementIterator extends Object implements Iterator<DiscreteSet>
An iterator over a list of sets that adds a given expression to each of the element sets before returning. The original list is not changed by this.
Constructor and Description |
---|
AddElementIterator(net.sourceforge.czt.z.ast.Expr expr,
List<net.sourceforge.czt.z.ast.Expr> list,
int start,
int end)
Creates a new iterator over the given list from start position
to end position that adds the given expression to each of the
element sets returned.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
DiscreteSet |
next()
Returns a DiscreteSet containing the expression given in the
constructor and all the elements of the current list element.
|
void |
remove()
Not supported by this iterator so throws an
UnsupportedOperationException when called.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public AddElementIterator(net.sourceforge.czt.z.ast.Expr expr, List<net.sourceforge.czt.z.ast.Expr> list, int start, int end)
expr
- the expression to be added to each of the sets returned.list
- the list to be iterated over. It is assumed that
the elements of that list are of type Collectionstart
- the start position to start iterating fromend
- the list position at which the iteration will stoppublic boolean hasNext()
hasNext
in interface Iterator<DiscreteSet>
public DiscreteSet next()
next
in interface Iterator<DiscreteSet>
ClassCastException
- if the list element at the current
position is not of type @code{Collectionpublic void remove()
remove
in interface Iterator<DiscreteSet>
Copyright © 2003–2016 Community Z Tools Project. All rights reserved.