net.nexttext.input
Class InputSource

java.lang.Object
  extended by net.nexttext.input.InputSource
Direct Known Subclasses:
Keyboard, Mouse

public abstract class InputSource
extends java.lang.Object

An interface to external events.

InputSources are generally used by Behaviours which want to change what they do based on external information. An InputSource can be accessed in two ways, as a series of events, or as an object with state. To access events, a Behaviour gets an InputSourceIterator from the input source, and reads events from it. To access state, a Behaviour uses InputSource specific state accessors.

Events are buffered internally in the InputSource, so that all Behaviours will see all events. If a Behaviour is slow in accessing events, they may be flushed from the buffer, and it will miss events.


Constructor Summary
InputSource()
           
 
Method Summary
 InputSourceIterator getIterator()
          Gets an iterator over the list of events of the input source.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputSource

public InputSource()
Method Detail

getIterator

public InputSourceIterator getIterator()
Gets an iterator over the list of events of the input source.

Returns:
an iterator over the list of events