com.yobotics.simulationconstructionset
Interface YoVariableHolder

All Known Implementing Classes:
ContactablePinJointRobot, ContactableRobot, ContactableSelectableBoxRobot, ContactableSphereRobot, ContactableStaticCylinderRobot, ContactableStaticRobot, ContactableToroidRobot, DataBuffer, PointMassRobot, Robot, Simulation, SimulationConstructionSet, SimulationConstructionSetTest.SimpleRobot, SingleRigidBodyRobot, YoVariableHolderImplementation, YoVariableRegistry

public interface YoVariableHolder


Method Summary
 java.util.ArrayList<YoVariable> getAllVariables()
          Returns all the YoVariables in this YoVariableHolder
 YoVariable[] getAllVariablesArray()
          Returns all the YoVariables in this YoVariableHolder
 YoVariable getVariable(java.lang.String name)
          Gets a YoVariable with the given name if it is in this YoVariableHolder, otherwise returns null.
 YoVariable getVariable(java.lang.String nameSpaceEnding, java.lang.String name)
          Gets a YoVariable with the given nameSpace and name if it is in this YoVariableHolder, otherwise returns null.
 java.util.ArrayList<YoVariable> getVariables(NameSpace nameSpace)
          Returns all the YoVariables with the given nameSpace that are in this YoVariableHolder, empty if there are none.
 java.util.ArrayList<YoVariable> getVariables(java.lang.String name)
          Returns all the YoVariables with the given name that are in this YoVariableHolder, empty if there are none.
 java.util.ArrayList<YoVariable> getVariables(java.lang.String nameSpaceEnding, java.lang.String name)
          Returns all the YoVariables with the given nameSpace and name that are in this YoVariableHolder, empty if there are none.
 boolean hasUniqueVariable(java.lang.String name)
          Checks if this YoVariableHolder holds exactly one YoVariable with the given name.
 boolean hasUniqueVariable(java.lang.String nameSpaceEnding, java.lang.String name)
          Checks if this YoVariableHolder holds exactly one YoVariable with the given nameSpace and name.
 

Method Detail

getAllVariables

java.util.ArrayList<YoVariable> getAllVariables()
Returns all the YoVariables in this YoVariableHolder

Returns:
ArrayList

getAllVariablesArray

YoVariable[] getAllVariablesArray()
Returns all the YoVariables in this YoVariableHolder

Returns:
YoVariable[]

getVariable

YoVariable getVariable(java.lang.String name)
Gets a YoVariable with the given name if it is in this YoVariableHolder, otherwise returns null. If name contains a ".", then the YoVariable's nameSpace ending must match that of name. If there is more than one YoVariable that matches, then throws a RuntimeException.

Parameters:
name - String Name of YoVariable to get. If contains a ".", then YoVariable's nameSpace ending must match that of name.
Returns:
YoVariable matching the given name.

hasUniqueVariable

boolean hasUniqueVariable(java.lang.String name)
Checks if this YoVariableHolder holds exactly one YoVariable with the given name. If so, returns true, otherwise returns false. If name contains a ".", then the YoVariable's nameSpace ending must match that of name. If there is more than one YoVariable that matches, returns false.

Parameters:
name - String Name of YoVariable to check for. If contains a ".", then YoVariable's nameSpace ending must match that of name.
Returns:
boolean Whether or not this YoVariableHolder holds exactly one Variable of the given name.

getVariable

YoVariable getVariable(java.lang.String nameSpaceEnding,
                       java.lang.String name)
Gets a YoVariable with the given nameSpace and name if it is in this YoVariableHolder, otherwise returns null. If name contains a ".", then throws a RuntimeException. If there is more than one YoVariable that matches, then throws a RuntimeException.

Parameters:
nameSpaceEnding - String nameSpaceEnding ending of YoVariable to get. The YoVariable's nameSpace ending must match that of nameSpace.
name - String Name of YoVariable to get. If contains a ".", then throws a RuntimeException.
Returns:
YoVariable matching the given nameSpace and name.

hasUniqueVariable

boolean hasUniqueVariable(java.lang.String nameSpaceEnding,
                          java.lang.String name)
Checks if this YoVariableHolder holds exactly one YoVariable with the given nameSpace and name. If so, returns true, otherwise returns false. If name contains a ".", then throws a RuntimeException. If there is more than one YoVariable that matches, returns false.

Parameters:
nameSpaceEnding - String NameSpace ending of YoVariable to check for. The YoVariable's nameSpace ending must match that of nameSpace.
name - String Name of YoVariable to check for. If contains a ".", then throws a RuntimeException.
Returns:
boolean Whether or not this YoVariableHolder holds exactly one Variable that matches the given nameSpace and name.

getVariables

java.util.ArrayList<YoVariable> getVariables(java.lang.String nameSpaceEnding,
                                             java.lang.String name)
Returns all the YoVariables with the given nameSpace and name that are in this YoVariableHolder, empty if there are none. If name contains a ".", then throws a RuntimeException.

Parameters:
nameSpaceEnding - String NameSpace ending of YoVariables to get. The YoVariable's nameSpace ending must match that of nameSpace.
name - String Name of YoVariable to get. If contains a ".", then throws a RuntimeException.
Returns:
ArrayList matching the given nameSpace and name.

getVariables

java.util.ArrayList<YoVariable> getVariables(java.lang.String name)
Returns all the YoVariables with the given name that are in this YoVariableHolder, empty if there are none. If name contains a ".", then the YoVariable's nameSpace ending must match that of name.

Parameters:
name - String Name of YoVariable to get. If name contains a ".", then the YoVariable's nameSpace ending must match that of name.
Returns:
ArrayList matching the given name.

getVariables

java.util.ArrayList<YoVariable> getVariables(NameSpace nameSpace)
Returns all the YoVariables with the given nameSpace that are in this YoVariableHolder, empty if there are none.

Parameters:
nameSpace - NameSpace to match.
Returns:
ArrayList matching YoVariables.