public class UpdatableIterator<E> extends Object implements ResettableIterator<E>, RepeatableIterator<E>
| Constructor and Description |
|---|
UpdatableIterator(ResettableIterator<E> iterator) |
| Modifier and Type | Method and Description |
|---|---|
void |
forEachRemaining(java.util.function.Consumer<? super E> action) |
boolean |
hasNext() |
E |
next() |
void |
remove() |
void |
repeat()
If the current value should repeat.
|
void |
reset()
When reset is called, then if a new iterator has been provided by another thread via update method,
then we switch over to using the new iterator.
|
void |
update(ResettableIterator<E> iterator)
This can be called by another thread.
|
public UpdatableIterator(ResettableIterator<E> iterator)
public void update(ResettableIterator<E> iterator)
iterator - the new iterator to update to.public void reset()
reset in interface ResettableIterator<E>public void forEachRemaining(java.util.function.Consumer<? super E> action)
forEachRemaining in interface Iterator<E>public void repeat()
RepeatableIteratorrepeat in interface RepeatableIterator<E>Copyright © 2020 The Apache Software Foundation. All Rights Reserved.