org.simbrain.gauge
Class GaugedVariables

java.lang.Object
  extended by org.simbrain.gauge.GaugedVariables

public class GaugedVariables
extends Object

GaugedVariables contains information about what data this gauge represents.


Constructor Summary
GaugedVariables()
          Default constructor for creating gauged variables.
GaugedVariables(Gauge gauge)
          Creates gauged Variables.
 
Method Summary
 void addVariable(GaugeSource toAdd)
          Add a new gauged variable.
 void changeVariable(GaugeSource oldVar, GaugeSource newVar)
          Update a gauged variable.
protected  void clear()
          Clears all variables for new gauge.
 String getNetworkName()
           
 int getNumVariables()
          Returns the number of gauged variables.
 Gauge getParent()
           
 String getPersistentVariables()
           
 double[] getState()
          Converts gauged variable states into a double array to be sent to the hisee gauge.
 void initCastor(NetworkFrame net)
          Used in persisting.
 void prepareToSave()
          Called before saving to set persistent variables.
 void removeVariable(GaugeSource toRemove)
          Remove a gauged variable.
 void setNetworkName(String networkName)
           
 void setParent(Gauge parent)
          Sets which gauge variables are attached to.
 void setPersistentVariables(String persistentGaugedVars)
           
protected  void setVariables(Collection gaugedVars)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GaugedVariables

public GaugedVariables()
Default constructor for creating gauged variables.


GaugedVariables

public GaugedVariables(Gauge gauge)
Creates gauged Variables.

Parameters:
gauge - to be used for variables
Method Detail

initCastor

public void initCastor(NetworkFrame net)
Used in persisting.

Parameters:
net - the network frame to which this is connected

clear

protected void clear()
Clears all variables for new gauge.


addVariable

public void addVariable(GaugeSource toAdd)
Add a new gauged variable.

Parameters:
toAdd - variable to add.

changeVariable

public void changeVariable(GaugeSource oldVar,
                           GaugeSource newVar)
Update a gauged variable.

Parameters:
oldVar - out with the old
newVar - in with the new

removeVariable

public void removeVariable(GaugeSource toRemove)
Remove a gauged variable.

Parameters:
toRemove - the variable to remove.

getNumVariables

public int getNumVariables()
Returns the number of gauged variables.

Returns:
the number of gauged variables.

prepareToSave

public void prepareToSave()
Called before saving to set persistent variables.


getState

public double[] getState()
Converts gauged variable states into a double array to be sent to the hisee gauge.

Returns:
variables in double

getPersistentVariables

public String getPersistentVariables()
Returns:
Returns the persistentGaugedVars.

setPersistentVariables

public void setPersistentVariables(String persistentGaugedVars)
Parameters:
persistentGaugedVars - The persistentGaugedVars to set.

setVariables

protected void setVariables(Collection gaugedVars)
Parameters:
gaugedVars - The gaugedVars to set.

getNetworkName

public String getNetworkName()
Returns:
Returns the networkName.

setNetworkName

public void setNetworkName(String networkName)
Parameters:
networkName - The networkName to set.

getParent

public Gauge getParent()
Returns:
parent gauge.

setParent

public void setParent(Gauge parent)
Sets which gauge variables are attached to.

Parameters:
parent - gauge for gauge variable

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object