public class DisposableValueBoundIterator extends DisposableValueIterator
| Constructor and Description |
|---|
DisposableValueBoundIterator(IntVar var) |
| Modifier and Type | Method and Description |
|---|---|
void |
bottomUpInit()
Prepare iteration from smallest value to highest value (using
ValueIterator.hasNext() / ValueIterator.next())
ValueIterator vit = ...;
vit.bottomUpInit();
while(vit.hasNext()){
int v = vit.next();
// operate on value v here
}
OR
|
boolean |
hasNext()
Returns true if the iteration has more values.
|
boolean |
hasPrevious()
Returns true if the iteration has more ranges.
|
int |
next()
Compute and return the next value.
|
int |
previous()
Compute and return the previous value.
|
void |
topDownInit()
Prepare iteration from highest value to smallest value (using
ValueIterator.hasPrevious() / ValueIterator.previous())
ValueIterator vit = ...;
vit.topDownInit();
while(vit.hasPrevious()){
int v = vit.previous();
// operate on value v here
} |
dispose, init, isNotReusable, removepublic DisposableValueBoundIterator(IntVar var)
public void bottomUpInit()
ValueIteratorValueIterator.hasNext() / ValueIterator.next())
ValueIterator vit = ...;
vit.bottomUpInit();
while(vit.hasNext()){
int v = vit.next();
// operate on value v here
}
OR
bottomUpInit in interface ValueIteratorbottomUpInit in class DisposableValueIteratorpublic void topDownInit()
ValueIteratorValueIterator.hasPrevious() / ValueIterator.previous())
ValueIterator vit = ...;
vit.topDownInit();
while(vit.hasPrevious()){
int v = vit.previous();
// operate on value v here
}topDownInit in interface ValueIteratortopDownInit in class DisposableValueIteratorpublic boolean hasNext()
ValueIterator
ValueIterator vit = ...;
vit.bottomUpInit();
while(vit.hasNext()){
int v = vit.next();
// operate on value v here
}
OR
public boolean hasPrevious()
ValueIterator
ValueIterator vit = ...;
vit.topDownInit();
while(vit.hasPrevious()){
int v = vit.previous();
// operate on value v here
}public int next()
ValueIterator
ValueIterator vit = ...;
vit.bottomUpInit();
while(vit.hasNext()){
int v = vit.next();
// operate on value v here
}
OR
public int previous()
ValueIterator
ValueIterator vit = ...;
vit.topDownInit();
while(vit.hasPrevious()){
int v = vit.previous();
// operate on value v here
}Copyright © 2018. All rights reserved.