org.eigenbase.runtime
Class QueueIteratorTest.TickIterator
java.lang.Object
org.eigenbase.runtime.QueueIteratorTest.TickIterator
- All Implemented Interfaces:
- Iterator
- Enclosing class:
- QueueIteratorTest
private static class QueueIteratorTest.TickIterator
- extends Object
- implements Iterator
Iterator which returns an element from an array on a regular basis.
Every clock tick until the array is exhausted, hasNext()
returns true, then the following clock tick, next()
returns an
object. If you call a method too early, the method waits until the
appropriate time.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
verbose
private final boolean verbose
startTime
private final long startTime
current
private int current
values
private final Object[] values
QueueIteratorTest.TickIterator
QueueIteratorTest.TickIterator(Object[] values,
boolean verbose,
long startTime)
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface Iterator
waitUntil
private void waitUntil(int tick)
next
public Object next()
- Specified by:
next
in interface Iterator
remove
public void remove()
- Specified by:
remove
in interface Iterator
demo
public static void demo()