net.nexttext.input
Class InputSourceIterator

java.lang.Object
  extended by net.nexttext.input.InputSourceIterator

public class InputSourceIterator
extends java.lang.Object

An iterator over the events of a specifed input source.

The iterator keeps the array index of the last event it fetched. When new events are added to the list, the iterator can fetch the new events, one by one, until the last one is reached.


Method Summary
 boolean hasNext()
          If there is an event waiting.
 InputEvent next()
          Returns the next object in the iteration
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasNext

public boolean hasNext()
If there is an event waiting.

Even if it returns false, it may return true later, if a new event has occurred. This is different behaviour than java.util.Iterator.


next

public InputEvent next()
Returns the next object in the iteration

Throws:
java.util.NoSuchElementException - if there's no element available.