|
||||||||||
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 | |
---|---|
static int |
NULL_VALUE
|
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,
boolean allowNullValue)
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)
|
Method Summary | ||
---|---|---|
T |
convertDoubleToEnum(double doubleValue)
|
|
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,
boolean allowNullValue)
shortcut construction method; infers the type parameter from the declared type |
|
boolean |
getAllowNullValue()
|
|
java.lang.Class<T> |
getEnumType()
|
|
T |
getEnumValue()
Retrieve the enum value of this YoVariable. |
|
T[] |
getEnumValues()
|
|
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)
|
|
void |
getValueStringFromEnum(java.lang.StringBuffer stringBuffer,
T enumValue)
|
|
YoVariableType |
getYoVariableType()
|
|
void |
set(T enumValue)
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 java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int NULL_VALUE
Constructor Detail |
---|
public EnumYoVariable(java.lang.String name, java.lang.String description, YoVariableRegistry registry, java.lang.Class<T> enumType, boolean allowNullValue)
name
- name to be used for all references of this variable by SCSdescription
- a short descriptionregistry
- YoVariableRegistryenumType
- the class representing the type of the enumpublic EnumYoVariable(java.lang.String name, YoVariableRegistry registry, java.lang.Class<T> enumType)
Method 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, boolean allowNullValue)
public boolean valueEquals(T value)
value
- Enum to be compared
public java.lang.Class<T> getEnumType()
public void set(T enumValue)
enumValue
- Enum to store in this YoVariablepublic boolean getAllowNullValue()
public T[] getEnumValues()
public T getEnumValue()
public void setValueFromDouble(double value)
setValueFromDouble
in class YoVariable
public T convertDoubleToEnum(double doubleValue)
public double getValueAsDouble()
getValueAsDouble
in class YoVariable
public java.lang.String toString()
toString
in class java.lang.Object
public void getValueString(java.lang.StringBuffer stringBuffer)
getValueString
in class YoVariable
stringBuffer
- StringBuffer to which the value will be appendedpublic void getValueStringFromDouble(java.lang.StringBuffer stringBuffer, double doubleValue)
getValueStringFromDouble
in class YoVariable
public void getValueStringFromEnum(java.lang.StringBuffer stringBuffer, T enumValue)
public YoVariableType getYoVariableType()
getYoVariableType
in class YoVariable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |