The Physiologist's Friend Simulation API

ch.unizh.ini.friend.tests
Class OutputPrinter

java.lang.Object
  extended by ch.unizh.ini.friend.simulation.AbstractAcceptsInput
      extended by ch.unizh.ini.friend.simulation.AbstractMonitor
          extended by ch.unizh.ini.friend.tests.OutputPrinter
All Implemented Interfaces:
AcceptsInput, Updateable, Serializable

public class OutputPrinter
extends AbstractMonitor

Prints the output value of an ServesOutput instance to a stream.

Version:
$Revision: 1.10 $
Author:
Christof Marti
See Also:
Serialized Form

Field Summary
protected  String post
          The string to append to the ouput.
protected  String pre
          The string to prepend to the ouput.
protected  PrintStream stream
          The stream to print to.
 
Fields inherited from class ch.unizh.ini.friend.simulation.AbstractAcceptsInput
inputs
 
Constructor Summary
OutputPrinter(Collection inputs, String pre, String post, PrintStream stream)
          Initializes the instance to prepend a given string and append another given string on output on the given stream.
OutputPrinter(ServesOutput input, String pre, String post, PrintStream stream)
          Initializes the instance to prepend a given string and append another given string on output on the given stream.
 
Method Summary
 void compute(float dt)
          Computes the new state of this component of the simulation.
 
Methods inherited from class ch.unizh.ini.friend.simulation.AbstractMonitor
getInput, getInputs, setInput, setInputs, update
 
Methods inherited from class ch.unizh.ini.friend.simulation.AbstractAcceptsInput
averageInputs, cloneObject, connectOneToAll, connectOneToOne, getCollectionInstance, integrateInputs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pre

protected String pre
The string to prepend to the ouput.


post

protected String post
The string to append to the ouput.


stream

protected PrintStream stream
The stream to print to.

Constructor Detail

OutputPrinter

public OutputPrinter(Collection inputs,
                     String pre,
                     String post,
                     PrintStream stream)
Initializes the instance to prepend a given string and append another given string on output on the given stream.

Parameters:
inputs - A collection of inputs.
pre - The string to prepend.
post - The string to append.
stream - The stream to write to.

OutputPrinter

public OutputPrinter(ServesOutput input,
                     String pre,
                     String post,
                     PrintStream stream)
Initializes the instance to prepend a given string and append another given string on output on the given stream.

Parameters:
input - A collection of inputs.
pre - The string to prepend.
post - The string to append.
stream - The stream to write to.
Method Detail

compute

public void compute(float dt)
Computes the new state of this component of the simulation.

Parameters:
dt - The time that has passed since the last invocation.

http://www.ini.unizh.ch/~tobi/friend