dsg.smart
Class SMBase

java.lang.Object
  extended bydsg.smart.SMBase
All Implemented Interfaces:
StreamModule
Direct Known Subclasses:
DoubleSink, SinSource

public abstract class SMBase
extends java.lang.Object
implements StreamModule

Base class useful in writing Stream Modules.


Constructor Summary
SMBase(int numInputs, int numOutputs)
           
 
Method Summary
 java.io.InputStream getInput(int i)
          Returns the stream attached to the ith input.
 int getNumInputs()
          How many inputs does this stream module have?
 int getNumOutputs()
          How many outputs does this stream module have?
 java.io.OutputStream getOutput(int i)
          Returns the output stream attached to the ith output.
 void setInput(int i, java.io.InputStream fin)
          Assigns input stream --- called by MIT code when connecting stream modules.
 void setOutput(int i, java.io.OutputStream fout)
          Assigns output stream --- called by MIT code when connecting stream modules.
 void stop()
          Generally called from a separate thread from run().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface dsg.smart.StreamModule
run
 

Constructor Detail

SMBase

public SMBase(int numInputs,
              int numOutputs)
Method Detail

getNumInputs

public int getNumInputs()
Description copied from interface: StreamModule
How many inputs does this stream module have?

Specified by:
getNumInputs in interface StreamModule

getNumOutputs

public int getNumOutputs()
Description copied from interface: StreamModule
How many outputs does this stream module have?

Specified by:
getNumOutputs in interface StreamModule

setInput

public void setInput(int i,
                     java.io.InputStream fin)
Assigns input stream --- called by MIT code when connecting stream modules.

Specified by:
setInput in interface StreamModule

getInput

public java.io.InputStream getInput(int i)
Description copied from interface: StreamModule
Returns the stream attached to the ith input.

Specified by:
getInput in interface StreamModule

setOutput

public void setOutput(int i,
                      java.io.OutputStream fout)
Assigns output stream --- called by MIT code when connecting stream modules.

Specified by:
setOutput in interface StreamModule

getOutput

public java.io.OutputStream getOutput(int i)
Description copied from interface: StreamModule
Returns the output stream attached to the ith output.

Specified by:
getOutput in interface StreamModule

stop

public void stop()
Description copied from interface: StreamModule
Generally called from a separate thread from run(). Cleans up by closing all upstream and downstream pipes, thus causing an exception in run(), which will then exit.

Specified by:
stop in interface StreamModule