Nengo.ca

ca.nengo.model.impl
Class NetworkImpl.OriginWrapper

java.lang.Object
  extended by ca.nengo.model.impl.NetworkImpl.OriginWrapper
All Implemented Interfaces:
Origin, java.io.Serializable, java.lang.Cloneable
Enclosing class:
NetworkImpl

public class NetworkImpl.OriginWrapper
extends java.lang.Object
implements Origin

Wraps an Origin with a new name (for exposing outside Network).

See Also:
Serialized Form

Constructor Summary
NetworkImpl.OriginWrapper()
          Default constructor TODO: Is this necessary?
NetworkImpl.OriginWrapper(Node node, Origin wrapped, java.lang.String name)
           
 
Method Summary
 Origin clone()
           
 Origin clone(Ensemble ensemble)
          Clone method that changes necessary parameters to point to a new parent, for use in cloning ensembles, etc.
 Origin getBaseOrigin()
          Unwraps Origin until it finds one that isn't wrapped
 int getDimensions()
           
 java.lang.String getName()
           
 Node getNode()
           
 boolean getRequiredOnCPU()
           
 InstantaneousOutput getValues()
           
 Origin getWrappedOrigin()
           
 void setName(java.lang.String name)
           
 void setNode(Node node)
           
 void setRequiredOnCPU(boolean val)
           
 void setValues(InstantaneousOutput values)
           
 void setWrappedOrigin(Origin wrapped)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetworkImpl.OriginWrapper

public NetworkImpl.OriginWrapper(Node node,
                                 Origin wrapped,
                                 java.lang.String name)
Parameters:
node - Parent node
wrapped - Warpped Origin
name - Name of new origin

NetworkImpl.OriginWrapper

public NetworkImpl.OriginWrapper()
Default constructor TODO: Is this necessary?

Method Detail

getWrappedOrigin

public Origin getWrappedOrigin()
Returns:
The underlying wrapped Origin

getBaseOrigin

public Origin getBaseOrigin()
Unwraps Origin until it finds one that isn't wrapped

Returns:
Base origin if there are multiple levels of wrapping

setWrappedOrigin

public void setWrappedOrigin(Origin wrapped)
Parameters:
wrapped - Set the underlying wrapped Origin

getName

public java.lang.String getName()
Specified by:
getName in interface Origin
Returns:
Name of this Origin (unique in the scope of a source of Origins, eg a Neuron or Ensemble)

setName

public void setName(java.lang.String name)
Parameters:
name - Name

getDimensions

public int getDimensions()
Specified by:
getDimensions in interface Origin
Returns:
Dimensionality of information coming from this Origin (eg number of axons, or dimension of decoded function of variables represented by the Ensemble)

getValues

public InstantaneousOutput getValues()
                              throws SimulationException
Specified by:
getValues in interface Origin
Returns:
Instantaneous output from this Origin.
Throws:
SimulationException - if there is any problem retrieving values

setValues

public void setValues(InstantaneousOutput values)
Specified by:
setValues in interface Origin

getNode

public Node getNode()
Specified by:
getNode in interface Origin
Returns:
The Node to which the Origin belongs

setNode

public void setNode(Node node)
Parameters:
node - Parent node

clone

public Origin clone()
             throws java.lang.CloneNotSupportedException
Specified by:
clone in interface Origin
Overrides:
clone in class java.lang.Object
Returns:
Valid clone
Throws:
java.lang.CloneNotSupportedException - if clone cannot be made

clone

public Origin clone(Ensemble ensemble)
             throws java.lang.CloneNotSupportedException
Description copied from interface: Origin
Clone method that changes necessary parameters to point to a new parent, for use in cloning ensembles, etc.

Specified by:
clone in interface Origin
Parameters:
ensemble - New parent ensemble
Returns:
A clone of the origin for the new parent ensemble
Throws:
java.lang.CloneNotSupportedException - if clone cannot be made

setRequiredOnCPU

public void setRequiredOnCPU(boolean val)
Specified by:
setRequiredOnCPU in interface Origin

getRequiredOnCPU

public boolean getRequiredOnCPU()
Specified by:
getRequiredOnCPU in interface Origin

Nengo.ca