|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.yobotics.simulationconstructionset.YoVariable
com.yobotics.simulationconstructionset.EnumYoVariable<T>
public class EnumYoVariable<T extends java.lang.Enum<T>>
Field Summary |
---|
Fields inherited from class com.yobotics.simulationconstructionset.YoVariable |
---|
MAX_LENGTH_SHORT_NAME |
Constructor Summary | |
---|---|
EnumYoVariable(java.lang.String name,
java.lang.String description,
YoVariableRegistry registry,
java.lang.Class<T> enumType)
Creates a new YoVariable with the given name and type and adds it to the specified registry. |
|
EnumYoVariable(java.lang.String name,
YoVariableRegistry registry,
java.lang.Class<T> enumType)
Creates a new variable of type ENUM based on the provided array of values and registered with the given YoVariableRegistry. |
Method Summary | ||
---|---|---|
static
|
create(java.lang.String name,
java.lang.Class<T> enumType,
YoVariableRegistry registry)
shortcut construction method; infers the type parameter from the declared type |
|
static
|
create(java.lang.String name,
java.lang.String description,
java.lang.Class<T> enumType,
YoVariableRegistry registry)
shortcut construction method; infers the type parameter from the declared type |
|
T |
getEnumValue()
Retrieve the enum value of this YoVariable. |
|
T[] |
getEnumValues()
|
|
void |
getValue(java.lang.StringBuffer stringBuffer)
Appends the value of this variable to the end of the given StringBuffer. |
|
double |
getValueAsDouble()
|
|
YoVariableType |
getYoVariableType()
|
|
void |
set(T nextStateEnum)
Set the enum value of this variable. |
|
void |
setValueFromDouble(double value)
|
|
java.lang.String |
toString()
|
|
boolean |
valueEquals(T value)
Check if the value contained by this variable is equal to the given enum. |
Methods inherited from class com.yobotics.simulationconstructionset.YoVariable |
---|
addVariableChangedListener, fullNameEndsWith, getDescription, getFullNameWithNameSpace, getManualScalingMax, getManualScalingMin, getName, getName, getNameAndValue, 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 |
---|
public EnumYoVariable(java.lang.String name, YoVariableRegistry registry, java.lang.Class<T> enumType)
name
- name to be used for all references of this variable by SCSregistry
- YoVariableRegistry with which this variable is to be registered.YoVariableRegistry
public EnumYoVariable(java.lang.String name, java.lang.String description, YoVariableRegistry registry, java.lang.Class<T> enumType)
name
- name to be used for all references of this variable by SCSdescription
- a short descriptionregistry
- YoVariableRegistryenumType
- the class representing the type of the enumMethod Detail |
---|
public static <T extends java.lang.Enum<T>> EnumYoVariable<T> create(java.lang.String name, java.lang.Class<T> enumType, YoVariableRegistry registry)
public static <T extends java.lang.Enum<T>> EnumYoVariable<T> create(java.lang.String name, java.lang.String description, java.lang.Class<T> enumType, YoVariableRegistry registry)
public boolean valueEquals(T value)
value
- Enum to be compared
public void set(T nextStateEnum)
nextStateEnum
- Enum to store in this YoVariablepublic T[] getEnumValues()
public T getEnumValue()
public void setValueFromDouble(double value)
setValueFromDouble
in class YoVariable
public double getValueAsDouble()
getValueAsDouble
in class YoVariable
public java.lang.String toString()
toString
in class java.lang.Object
public void getValue(java.lang.StringBuffer stringBuffer)
getValue
in class YoVariable
stringBuffer
- StringBuffer to which the value will be appendedpublic YoVariableType getYoVariableType()
getYoVariableType
in class YoVariable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |