neosim.iface
Interface EntityClass

All Known Implementing Classes:
EntityClassImpl

public interface EntityClass
extends NeosimClass


Method Summary
 PortID addInPort(EventClass ec)
           
 PortID addInPort(EventClass ec, java.lang.String name)
          Add an input port to the class.
 PortID addOutPort(EventClass ec)
           
 PortID addOutPort(EventClass ec, java.lang.String name)
          Add an output port to the class.
 PortID getInPort(java.lang.String name)
          Get an input port given a name.
 java.util.Vector getInPorts()
           
 java.lang.String getName()
          Returns the name of this class
 PortID getOutPort(java.lang.String name)
          Get an output port given a name
 java.util.Vector getOutPorts()
           
 void init(java.lang.String name, java.util.Hashtable args)
          Initialise from a bean - with a hashtable of arguments
 void init(java.lang.String name, java.lang.String args)
          Deprecated.  
 void initModule(ScriptReader sr)
          If this entity requires extra global initialisation (e.g.
 Entity makeEntity(Population p, int index)
          An EntityClass must provide a method to create an instance of the class
 
Methods inherited from interface neosim.iface.NeosimClass
getClassID, getPackage, getParent
 

Method Detail

makeEntity

public Entity makeEntity(Population p,
                         int index)
An EntityClass must provide a method to create an instance of the class
Parameters:
p - the population the entity will be part of
index - the index in the population

getName

public java.lang.String getName()
Returns the name of this class
Specified by:
getName in interface NeosimClass
Tags copied from interface: NeosimClass
Returns:
true if ec is a sub class of this one public boolean isAssignableFrom( NeosimClass ec ); /** Return the name of this class

init

public void init(java.lang.String name,
                 java.lang.String args)
Deprecated.  

Initialise from a bean - this is a temp placeholder

init

public void init(java.lang.String name,
                 java.util.Hashtable args)
Initialise from a bean - with a hashtable of arguments
Parameters:
name - the name of the entity class
args - string name/value pairs for arguments

addOutPort

public PortID addOutPort(EventClass ec,
                         java.lang.String name)
Add an output port to the class. This port will be valid for all entity instances of the class.
Parameters:
ec - the class of events the port generates
name - the name of the port (optional)
Returns:
the id of the output port (from 1..#output ports).

addOutPort

public PortID addOutPort(EventClass ec)

addInPort

public PortID addInPort(EventClass ec,
                        java.lang.String name)
Add an input port to the class. This port will be valid for all entity instances of the class.
Parameters:
ec - the class of events the port accepts
name - the name of the port (optional)
Returns:
the id of the input port (from 1..#input ports).

addInPort

public PortID addInPort(EventClass ec)

getOutPorts

public java.util.Vector getOutPorts()

getInPorts

public java.util.Vector getInPorts()

getOutPort

public PortID getOutPort(java.lang.String name)
Get an output port given a name
Parameters:
name - the name of the port
Returns:
the id of the port

getInPort

public PortID getInPort(java.lang.String name)
Get an input port given a name. By default ports are named "in1, in2, ..." and "out1, out2, ..."
Parameters:
name - the name of the port
Returns:
the id of the port

initModule

public void initModule(ScriptReader sr)
If this entity requires extra global initialisation (e.g. if it requires installing a C++ libxxx.so file on all processors) this method can be overridden to initialise the module. It is likely that this mechanism will be replaced by something more elegant.
Parameters:
sr - the calling script reader