public interface ISetIterator extends Iterator<Integer>
// 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();
...
}
Modifier and Type | Method and Description |
---|---|
default Integer |
next() |
int |
nextInt()
Returns the next int in the iteration.
|
default void |
notifyRemoving(int item)
Inform the iterator that value
item has been removed
(may require to update iterator structure) |
void |
reset()
Reset iteration (to avoid creating a new ISetIterator for every iteration)
|
forEachRemaining, hasNext, remove
void reset()
default void notifyRemoving(int item)
item
has been removed
(may require to update iterator structure)item
- removed valueint nextInt()
NoSuchElementException
- if the iteration has no more elementsCopyright © 2018. All rights reserved.