public class IntVarValueIterator extends Object implements Iterator<Integer>
for(int value:var){
...
}
that is equivalent to
int ub = var.getUB();
for(int value = var.getLB(); values <= ub; value = var.nextValue(value)){
...
}
Constructor and Description |
---|
IntVarValueIterator(IntVar v)
Creates an object to iterate over an IntVar values using
for(int value:var){
... |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
Integer |
next() |
void |
reset()
Reset iteration (to avoid creating a new IntVarValueIterator() for every iteration)
Stores the current upper bound
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, remove
public IntVarValueIterator(IntVar v)
for(int value:var){
...
}
that is equivalent to
int ub = var.getUB();
for(int value = var.getLB(); values <= ub; value = var.nextValue(value)){
...
}
v
- an integer variablesCopyright © 2018. All rights reserved.