com.yobotics.simulationconstructionset
Class YoVariable

java.lang.Object
  extended by com.yobotics.simulationconstructionset.YoVariable
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BooleanYoVariable, DoubleYoVariable, EnumYoVariable, IntegerYoVariable, LongYoVariable

public abstract class YoVariable
extends java.lang.Object
implements java.io.Serializable

Title: Yobotics! Simulation Construction Set

Description: Package for Simulating Dynamic Robots and Mechanisms

YoVariables provide a simple, convienent mechanism for storing and manipulating robot data. While each essentially contains a double value YoVariables are designed for integration into the SCS GUI. Once registered, a variable will automatically become available to the GUI for graphing, modification and other data manipulation. Historical values of all registered YoVariables are stored in the DataBuffer which may be exported for later use.

Copyright: Copyright (c) 2000-2011

Company: Yobotics, Inc. and IHMC

See Also:
Serialized Form

Field Summary
static int MAX_LENGTH_SHORT_NAME
           
 
Constructor Summary
YoVariable()
           
 
Method Summary
 void addVariableChangedListener(VariableChangedListener variableChangedListener)
           
 boolean fullNameEndsWithCaseInsensitive(java.lang.String name)
          fullNameEndsWith
 java.lang.String getDescription()
          Retrieve the description of this variable, "" if not specified.
 java.lang.String getFullNameWithNameSpace()
           
 double getManualScalingMax()
          Retrieve the current maximum value for manual scaling.
 double getManualScalingMin()
          Retrieve the current minimum value for manual scaling.
 java.lang.String getName()
          Retrieves the name of this YoVariable.
 void getName(java.lang.StringBuffer buffer)
          Adds the name of this variable to the provided string buffer.
 void getNameAndValueString(java.lang.StringBuffer stringBuffer)
          Adds the variables name & value to the beginning of the given string buffer
 void getNameAndValueStringFromDouble(java.lang.StringBuffer stringBuffer, double doubleValue)
           
 NameSpace getNameSpace()
           
 java.lang.String getNumericValueAsAString()
           
 java.lang.String getShortName()
          Retrieves a shortened version of this variables name.
abstract  double getValueAsDouble()
           
abstract  void getValueString(java.lang.StringBuffer stringBuffer)
           
abstract  void getValueStringFromDouble(java.lang.StringBuffer stringBuffer, double value)
           
 java.util.ArrayList<VariableChangedListener> getVariableChangedListeners()
           
 YoVariableRegistry getYoVariableRegistry()
           
abstract  YoVariableType getYoVariableType()
           
 boolean hasSameFullName(YoVariable variable)
          hasSameFullName
 void notifyVariableChangedListeners()
           
 void removeAllVariableChangedListeners()
           
 void removeVariableChangedListener(VariableChangedListener variableChangedListener)
           
 void setManualScalingMinMax(double minScaling, double maxScaling)
          Set the min and max scaling values for graphing purposes.
abstract  void setValueFromDouble(double value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_LENGTH_SHORT_NAME

public static final int MAX_LENGTH_SHORT_NAME
See Also:
Constant Field Values
Constructor Detail

YoVariable

public YoVariable()
Method Detail

getYoVariableRegistry

public YoVariableRegistry getYoVariableRegistry()

getName

public java.lang.String getName()
Retrieves the name of this YoVariable.

Returns:
the full name

getShortName

public java.lang.String getShortName()
Retrieves a shortened version of this variables name. The shortened name is created from the full name using the following method:
  1. Take the first 8 characters
  2. Insert "..."
  3. Add the last 9 characters

Returns:
the name of this variable reduced to 20 characters

getDescription

public java.lang.String getDescription()
Retrieve the description of this variable, "" if not specified.

Returns:
the description of this variable

getName

public void getName(java.lang.StringBuffer buffer)
Adds the name of this variable to the provided string buffer. This is done to avoid object creation.

Parameters:
buffer - StringBuffer to which the name will be added at the beginning

setManualScalingMinMax

public void setManualScalingMinMax(double minScaling,
                                   double maxScaling)
Set the min and max scaling values for graphing purposes. By default graphs are created using manual scaling based on these values where min = 0.0 and max = 1.0.

Parameters:
minScaling - double representing the min scale value
maxScaling - double representing the max scale value

getManualScalingMin

public double getManualScalingMin()
Retrieve the current minimum value for manual scaling.

Returns:
double min value

getManualScalingMax

public double getManualScalingMax()
Retrieve the current maximum value for manual scaling.

Returns:
double max value

getNameAndValueString

public void getNameAndValueString(java.lang.StringBuffer stringBuffer)
Adds the variables name & value to the beginning of the given string buffer

Parameters:
stringBuffer - StringBuffer to which the data will be added

getNameAndValueStringFromDouble

public void getNameAndValueStringFromDouble(java.lang.StringBuffer stringBuffer,
                                            double doubleValue)

fullNameEndsWithCaseInsensitive

public boolean fullNameEndsWithCaseInsensitive(java.lang.String name)
fullNameEndsWith

Parameters:
name - String
Returns:
boolean

hasSameFullName

public boolean hasSameFullName(YoVariable variable)
hasSameFullName

Parameters:
variable - YoVariable
Returns:
boolean

getFullNameWithNameSpace

public java.lang.String getFullNameWithNameSpace()

getNameSpace

public NameSpace getNameSpace()

addVariableChangedListener

public void addVariableChangedListener(VariableChangedListener variableChangedListener)

removeAllVariableChangedListeners

public void removeAllVariableChangedListeners()

getVariableChangedListeners

public java.util.ArrayList<VariableChangedListener> getVariableChangedListeners()

removeVariableChangedListener

public void removeVariableChangedListener(VariableChangedListener variableChangedListener)

notifyVariableChangedListeners

public void notifyVariableChangedListeners()

getNumericValueAsAString

public java.lang.String getNumericValueAsAString()

getYoVariableType

public abstract YoVariableType getYoVariableType()

getValueAsDouble

public abstract double getValueAsDouble()

setValueFromDouble

public abstract void setValueFromDouble(double value)

getValueString

public abstract void getValueString(java.lang.StringBuffer stringBuffer)

getValueStringFromDouble

public abstract void getValueStringFromDouble(java.lang.StringBuffer stringBuffer,
                                              double value)