The Physiologist's Friend Simulation API

ch.unizh.ini.friend.simulation
Class AbstractMonitor

java.lang.Object
  extended by ch.unizh.ini.friend.simulation.AbstractAcceptsInput
      extended by ch.unizh.ini.friend.simulation.AbstractMonitor
All Implemented Interfaces:
AcceptsInput, Updateable, Serializable
Direct Known Subclasses:
AudioOutput, OutputPrinter, SimpleOutputMonitor, SimulationReporter

public abstract class AbstractMonitor
extends AbstractAcceptsInput
implements Updateable

Default implementation for a monitor.

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

Field Summary
 
Fields inherited from class ch.unizh.ini.friend.simulation.AbstractAcceptsInput
inputs
 
Constructor Summary
AbstractMonitor()
          Creates a new instance with currently no inputs.
AbstractMonitor(Collection inputs)
          Creates a new instance with the given collection of inputs.
AbstractMonitor(int n)
          Creates a new instance with currently no inputs and with the given initial capacity.
AbstractMonitor(ServesOutput input)
          Creates a new instance with the given input.
 
Method Summary
 ServesOutput getInput()
          Returns the first (if any) input.
 Collection getInputs()
          Returns a collection of all inputs to this simulation component.
 void setInput(ServesOutput input)
          Sets the first (and only) input.
 void setInputs(Collection inputs)
          Sets the collection of all inputs to this simulation component.
 void update()
          Updates the actual state to the newly computed - aka double-buffering.
 
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
 
Methods inherited from interface ch.unizh.ini.friend.simulation.Updateable
compute
 

Constructor Detail

AbstractMonitor

public AbstractMonitor()
Creates a new instance with currently no inputs.


AbstractMonitor

public AbstractMonitor(int n)
Creates a new instance with currently no inputs and with the given initial capacity.

Parameters:
n - Number of initial capacity for inputs.

AbstractMonitor

public AbstractMonitor(Collection inputs)
Creates a new instance with the given collection of inputs.

Parameters:
inputs - The collection of inputs.

AbstractMonitor

public AbstractMonitor(ServesOutput input)
Creates a new instance with the given input.

Parameters:
input - The input.
Method Detail

getInputs

public Collection getInputs()
Returns a collection of all inputs to this simulation component. Note that the method is synchronized (it's otherwise identical to the overloaded one).

Specified by:
getInputs in interface AcceptsInput
Overrides:
getInputs in class AbstractAcceptsInput
Returns:
The inputs.

setInputs

public void setInputs(Collection inputs)
Sets the collection of all inputs to this simulation component. Note that the method is synchronized (it's otherwise identical to the overloaded one).

Specified by:
setInputs in interface AcceptsInput
Overrides:
setInputs in class AbstractAcceptsInput
Parameters:
inputs - The inputs.

getInput

public ServesOutput getInput()
Returns the first (if any) input. Note that the method is synchronized (it's otherwise identical to the overloaded one).

Specified by:
getInput in interface AcceptsInput
Overrides:
getInput in class AbstractAcceptsInput
Returns:
The input.

setInput

public void setInput(ServesOutput input)
Sets the first (and only) input. Note that the method is synchronized (it's otherwise identical to the overloaded one).

Specified by:
setInput in interface AcceptsInput
Overrides:
setInput in class AbstractAcceptsInput
Parameters:
input - The input.

update

public void update()
Updates the actual state to the newly computed - aka double-buffering. Does nothing here.

Specified by:
update in interface Updateable

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