com.yobotics.simulationconstructionset
Class BooleanYoVariable

java.lang.Object
  extended by com.yobotics.simulationconstructionset.YoVariable
      extended by com.yobotics.simulationconstructionset.BooleanYoVariable
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DelayedBooleanYoVariable, GlitchFilteredBooleanYoVariable

public class BooleanYoVariable
extends YoVariable

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.yobotics.simulationconstructionset.YoVariable
MAX_LENGTH_SHORT_NAME
 
Constructor Summary
BooleanYoVariable(java.lang.String name, java.lang.String description, YoVariableRegistry registry)
           
BooleanYoVariable(java.lang.String name, YoVariableRegistry registry)
           
 
Method Summary
 boolean convertDoubleToBoolean(double value)
           
 boolean getBooleanValue()
          Retrieve the boolean value of this YoVariable, if not of boolean type a warning will be printed.
 double getValueAsDouble()
           
 void getValueString(java.lang.StringBuffer stringBuffer)
          Appends the value of this variable to the end of the given StringBuffer.
 void getValueStringFromDouble(java.lang.StringBuffer stringBuffer, double doubleValue)
           
 YoVariableType getYoVariableType()
           
 void set(boolean value)
          Sets the boolean value of this YoVariable.
 void setValueFromDouble(double value)
           
 java.lang.String toString()
           
 boolean valueEquals(boolean value)
          Check if the value contained by this variable is equal to the given double.
 
Methods inherited from class com.yobotics.simulationconstructionset.YoVariable
addVariableChangedListener, fullNameEndsWithCaseInsensitive, getDescription, getFullNameWithNameSpace, getManualScalingMax, getManualScalingMin, getName, getName, getNameAndValueString, getNameAndValueStringFromDouble, getNameSpace, getNumericValueAsAString, getShortName, getVariableChangedListeners, getYoVariableRegistry, hasSameFullName, notifyVariableChangedListeners, removeAllVariableChangedListeners, removeVariableChangedListener, setManualScalingMinMax
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BooleanYoVariable

public BooleanYoVariable(java.lang.String name,
                         YoVariableRegistry registry)

BooleanYoVariable

public BooleanYoVariable(java.lang.String name,
                         java.lang.String description,
                         YoVariableRegistry registry)
Method Detail

valueEquals

public boolean valueEquals(boolean value)
Check if the value contained by this variable is equal to the given double. If not of double type a warning will be printed to the console.

Parameters:
value - boolean to be compared to
Returns:
are they equal?

getBooleanValue

public boolean getBooleanValue()
Retrieve the boolean value of this YoVariable, if not of boolean type a warning will be printed.

Returns:
boolean value of this

set

public void set(boolean value)
Sets the boolean value of this YoVariable. If not of boolean type a warning will be printed.

Parameters:
value - boolean

setValueFromDouble

public void setValueFromDouble(double value)
Specified by:
setValueFromDouble in class YoVariable

convertDoubleToBoolean

public boolean convertDoubleToBoolean(double value)

getValueAsDouble

public double getValueAsDouble()
Specified by:
getValueAsDouble in class YoVariable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getValueString

public void getValueString(java.lang.StringBuffer stringBuffer)
Appends the value of this variable to the end of the given StringBuffer. This representation is based on variable type.

Specified by:
getValueString in class YoVariable
Parameters:
stringBuffer - StringBuffer to which the value will be appended

getValueStringFromDouble

public void getValueStringFromDouble(java.lang.StringBuffer stringBuffer,
                                     double doubleValue)
Specified by:
getValueStringFromDouble in class YoVariable

getYoVariableType

public YoVariableType getYoVariableType()
Specified by:
getYoVariableType in class YoVariable