The Physiologist's Friend Simulation API

ch.unizh.ini.friend.tests
Class TimePrinter

java.lang.Object
  extended by ch.unizh.ini.friend.tests.TimePrinter
All Implemented Interfaces:
Updateable

public class TimePrinter
extends Object
implements Updateable

Prints the time dt, which is passed to all Updateable instances, to a stream.

Version:
$Revision: 1.5 $
Author:
Christof Marti

Field Summary
protected  PrintStream stream
          The stream to print to.
 
Constructor Summary
TimePrinter(PrintStream stream)
          Initializes the instance to print to the given stream.
 
Method Summary
 void compute(float dt)
          Computes the new state of this component of the simulation.
 void update()
          Updates the actual state to the newly computed - aka double-buffering.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stream

protected PrintStream stream
The stream to print to.

Constructor Detail

TimePrinter

public TimePrinter(PrintStream stream)
Initializes the instance to print to the given stream.

Parameters:
stream - The stream to write to.
Method Detail

compute

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

Specified by:
compute in interface Updateable
Parameters:
dt - The time that has passed since the last invocation.

update

public void update()
Updates the actual state to the newly computed - aka double-buffering. Doesn't need to do anything here.

Specified by:
update in interface Updateable

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