jass.engine
Class In

java.lang.Object
  extended by java.lang.Thread
      extended by jass.engine.In
All Implemented Interfaces:
Sink, java.lang.Runnable
Direct Known Subclasses:
SourcePlayer

public abstract class In
extends java.lang.Thread
implements Sink

Input unit which contains Sources and does something with them in run(). Maintains Vector of Sources. Needs only implementation of run().

Author:
Kees van den Doel (kvdoel@cs.ubc.ca)

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  java.util.Vector<Source> sourceContainer
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
In()
           
 
Method Summary
 java.lang.Object addSource(Source s)
          add source to Sink.
 Source[] getSources()
          Get array of sources.
 void removeSource(Source s)
          Remove Source.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sourceContainer

protected java.util.Vector<Source> sourceContainer
Constructor Detail

In

public In()
Method Detail

addSource

public java.lang.Object addSource(Source s)
                           throws SinkIsFullException
add source to Sink.

Specified by:
addSource in interface Sink
Parameters:
s - Source to add.
Returns:
object representing Source in Sink (may be null).
Throws:
SinkIsFullException

removeSource

public void removeSource(Source s)
Remove Source.

Specified by:
removeSource in interface Sink
Parameters:
s - Source to remove.

getSources

public Source[] getSources()
Get array of sources.

Specified by:
getSources in interface Sink
Returns:
array of the Sources, null if there are none.