本文整理了Java中us.ihmc.yoVariables.variable.YoEnum.getName()
方法的一些代码示例,展示了YoEnum.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YoEnum.getName()
方法的具体详情如下:
包路径:us.ihmc.yoVariables.variable.YoEnum
类名称:YoEnum
方法名:getName
暂无
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
public String getStateYoVariableName()
{
return stateYoVariable.getName();
}
代码示例来源:origin: us.ihmc/ihmc-yovariables
/**
* Returns String representation of this YoEnum.
*
* @return String representing this YoEnum and its current value as an integer
*/
@Override public String toString()
{
return String.format("%s: %s", getName(), getStringValue());
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
private static <T extends Enum<T>> String getFormattedEnumYoVariable(final YoEnum<T> yoEnum)
{
String enumValueName = yoEnum.getEnumValue() != null ? yoEnum.getEnumValue().name() : "null";
return yoEnum.getName() + ":" + enumValueName;
}
代码示例来源:origin: us.ihmc/ihmc-yovariables
/**
* Sets the YoEnum to the given enum.
*
* @param enumValue enum to set this YoEnum's internal enum state to
* @param notifyListeners boolean determining whether or not to call {@link #notifyVariableChangedListeners()}
* @return boolean if given value is valid and YoEnum is set or the same
* @throws RuntimeException if enumValue is null and null values are disallowed for this YoEnum
* @throws RuntimeException if enumValue ordinal falls out of allowed range for this YoEnum
*/
public boolean set(T enumValue, boolean notifyListeners)
{
checkIfBackedByEnum();
if (!allowNullValue && (enumValue == null))
{
throw new RuntimeException(
"Setting YoEnum " + getName() + " to null. Must set allowNullValue to true in the constructor if you ever want to set it to null.");
}
return set(enumValue == null ? NULL_VALUE : enumValue.ordinal(), notifyListeners);
}
代码示例来源:origin: us.ihmc/ihmc-yovariables
/**
* Creates a new YoEnum with the same parameters as this one, and registers it to the passed {@link YoVariableRegistry}.
*
* @param newRegistry YoVariableRegistry to duplicate this YoEnum to
* @return the newly created and registered YoEnum
*/
@Override public YoEnum<T> duplicate(YoVariableRegistry newRegistry)
{
YoEnum<T> retVar = new YoEnum<>(getName(), getDescription(), newRegistry, getEnumType(), getAllowNullValue());
retVar.set(getEnumValue());
return retVar;
}
内容来源于网络,如有侵权,请联系作者删除!