Module org.chocosolver
Interface ISetIterator
-
public interface ISetIterator extends Iterator<Integer>
Object to iterate over an ISet values using// more readable but includes autoboxing for(int value:set){ ... } // more verbose but without autoboxing ISetIterator iter = set.primitiveIterator(); while(iter.hasNext()){ int k = iter.nextInt(); ... }
- Author:
- Jean-Guillaume Fages
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Integer
next()
int
nextInt()
Returns the next int in the iteration.default void
notifyRemoving(int item)
Inform the iterator that valueitem
has been removed (may require to update iterator structure)void
reset()
Reset iteration (to avoid creating a new ISetIterator for every iteration)-
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, remove
-
-
-
-
Method Detail
-
reset
void reset()
Reset iteration (to avoid creating a new ISetIterator for every iteration)
-
notifyRemoving
default void notifyRemoving(int item)
Inform the iterator that valueitem
has been removed (may require to update iterator structure)- Parameters:
item
- removed value
-
nextInt
int nextInt()
Returns the next int in the iteration. Beware : avoids autoboxing- Returns:
- the next int in the iteration
- Throws:
NoSuchElementException
- if the iteration has no more elements
-
-