|
The Physiologist's Friend Simulation API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.unizh.ini.friend.simulation.AbstractAcceptsInput
public abstract class AbstractAcceptsInput
Provides the infrastructure for a simulation component with many inputs.
Field Summary | |
---|---|
Collection |
inputs
The input components for this one. |
Constructor Summary | |
---|---|
AbstractAcceptsInput()
Creates a new instance with currently no inputs. |
|
AbstractAcceptsInput(Collection inputs)
Creates a new instance with the given collection of inputs. |
|
AbstractAcceptsInput(int n)
Creates a new instance with currently no inputs and with the given initial capacity. |
|
AbstractAcceptsInput(Object input)
Creates a new instance with the given input. |
Method Summary | |
---|---|
protected float |
averageInputs()
Returns averaged inputs. |
static Object |
cloneObject(Object o)
Returns a deep-clone of the given object. |
static void |
connectOneToAll(Object source,
Collection sink)
Registers the given Object as an additional input of each of the
AcceptInput s from the given collection. |
static void |
connectOneToOne(Collection source,
Collection sink)
Registers the i-th Object from the first as an additional input of the i-th
AcceptInput from the second given collection. |
static Collection |
getCollectionInstance(AcceptsInput o,
int n)
Returns a collection of the given number of clones of the given object. |
ServesOutput |
getInput()
Returns the first (if any) input. |
Collection |
getInputs()
Returns a collection of all inputs to this simulation component. |
protected float |
integrateInputs()
Returns summed inputs. |
void |
setInput(ServesOutput input)
Sets the first (and only) input. |
void |
setInputs(Collection inputs)
Sets the collection of all inputs to this simulation component. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Collection inputs
Constructor Detail |
---|
public AbstractAcceptsInput()
public AbstractAcceptsInput(int n)
n
- Number of initial capacity for inputs.public AbstractAcceptsInput(Collection inputs)
inputs
- The collection of inputs.public AbstractAcceptsInput(Object input)
input
- The input.Method Detail |
---|
public static Object cloneObject(Object o) throws IOException, ClassNotFoundException
Serializable
interface for this hack to work.
This method has been copied from the Java FAQ at http://www.afu.com/
and is subject to the following conditions:
o
- The first node of the object graph to be cloned.
IOException
ClassNotFoundException
public static Collection getCollectionInstance(AcceptsInput o, int n)
o
- The object to be cloned.n
- The number of clones.
public static void connectOneToOne(Collection source, Collection sink)
Object
from the first as an additional input of the i-th
AcceptInput
from the second given collection.
source
- The data-'source' collection.sink
- The data-'sink' collection.public static void connectOneToAll(Object source, Collection sink)
Object
as an additional input of each of the
AcceptInput
s from the given collection.
source
- The data-'source' object.sink
- The data-'sink' collection.protected float integrateInputs()
protected float averageInputs()
public Collection getInputs()
getInputs
in interface AcceptsInput
public void setInputs(Collection inputs)
setInputs
in interface AcceptsInput
inputs
- The inputs.public ServesOutput getInput()
getInput
in interface AcceptsInput
public void setInput(ServesOutput input)
setInput
in interface AcceptsInput
input
- The input.
|
http://www.ini.unizh.ch/~tobi/friend | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |