|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.yobotics.simulationconstructionset.YoVariable
public class YoVariable
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) Jerry PrattCompany: Yobotics, Inc.
| Field Summary | |
|---|---|
static int |
MAX_LENGTH_SHORT_NAME
|
double |
val
|
| Constructor Summary | |
|---|---|
YoVariable(java.lang.String name,
java.lang.Enum[] enumeratorValues,
YoVariableRegistry registry)
Creates a new variable of type ENUM based on the provided array of values and registered with the given YoVariableRegistry. |
|
YoVariable(java.lang.String name,
java.lang.String description,
java.lang.Enum[] enumeratorValues,
YoVariableRegistry registry)
Creates a new YoVariable with the given name and type and adds it to the specified registry. |
|
YoVariable(java.lang.String name,
java.lang.String description,
YoVariableRegistry registry)
Creates a new YoVariable with the given name and adds it to the specified registry. |
|
YoVariable(java.lang.String name,
java.lang.String description,
YoVariableRegistry registry,
double minScaling,
double maxScaling)
Creates a new YoVariable with the given name and adds it to the specified registry. |
|
YoVariable(java.lang.String name,
java.lang.String description,
YoVariableType type,
YoVariableRegistry registry)
Creates a new YoVariable with the given name and adds it to the specified registry. |
|
YoVariable(java.lang.String name,
java.lang.String description,
YoVariableType type,
YoVariableRegistry registry,
double minScaling,
double maxScaling)
Creates a new YoVariable with the given name and type and adds it to the specified registry. |
|
YoVariable(java.lang.String name,
YoVariableRegistry registry)
Creates a new YoVariable with the given name and adds it to the specified registry. |
|
YoVariable(java.lang.String name,
YoVariableType type,
YoVariableRegistry registry)
Creates a new YoVariable of the given type with the given name and adds it to the specified registry. |
|
| Method Summary | |
|---|---|
void |
addObserver(Observer observer)
Adds a new observer |
boolean |
fullNameEndsWith(java.lang.String name)
fullNameEndsWith |
boolean |
getBooleanValue()
Retrieve the boolean value of this YoVariable, if not of boolean type a warning will be printed. |
java.lang.String |
getDescription()
Retrieve the description of this variable, "" if not specified. |
double |
getDoubleValue()
Retrieve the double value of this variable, if not of double type a warning will be printed. |
java.lang.Enum |
getEnumValue()
Retrieve the enum value of this YoVariable. |
java.lang.String |
getFullNameWithNameSpace()
|
int |
getIntegerValue()
Retrieve the integer representation of this variable. |
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 |
getNameAndValue(java.lang.StringBuffer stringBuffer)
Adds the variables name & value to the beginning of the given string buffer |
java.lang.String |
getShortName()
Retrieves a shortened version of this variables name. |
void |
getValue(java.lang.StringBuffer stringBuffer)
Appends the value of this variable to the end of the given StringBuffer. |
YoVariableRegistry |
getYoVariableRegistry()
|
YoVariableType |
getYoVariableType()
Retrieve the type of this YoVariable. |
boolean |
hasSameFullName(YoVariable variable)
hasSameFullName |
void |
notifyObservers(Event event)
Notifies observers of an event (most likely a change to the val field). |
void |
removeAllObservers()
Removes all observers |
void |
removeObserver(Observer observer)
Removes an observer |
void |
set(boolean value)
Sets the boolean value of this YoVariable. |
void |
set(double value)
Set the value of this YoVariable. |
void |
set(java.lang.Enum value)
Set the enum value of this variable. |
void |
set(int value)
Set the value of this YoVariable. |
void |
setManualScalingMinMax(double minScaling,
double maxScaling)
Set the min and max scaling values for graphing purposes. |
java.lang.String |
toString()
Retrieves a string representation of this variable. |
boolean |
valueEquals(boolean value)
Check if the value contained by this variable is equal to the given double. |
boolean |
valueEquals(double value)
Check if the value contained by this variable is equal to the given double. |
boolean |
valueEquals(java.lang.Enum value)
Check if the value contained by this variable is equal to the given enum. |
boolean |
valueEquals(int value)
Check if the value contained by this variable is equal to the given integer. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public double val
public static final int MAX_LENGTH_SHORT_NAME
| Constructor Detail |
|---|
public YoVariable(java.lang.String name,
YoVariableRegistry registry)
name - name to be used for all references of this variable by SCSregistry - YoVariableRegistry with which this variable is to be registerdYoVariableRegistry
public YoVariable(java.lang.String name,
java.lang.String description,
YoVariableRegistry registry)
name - name to be used for all references of this variable by SCSdescription - A short discription of this variableregistry - YoVariableRegistry with which this variable is to be registerdYoVariableRegistry
public YoVariable(java.lang.String name,
java.lang.String description,
YoVariableRegistry registry,
double minScaling,
double maxScaling)
name - name to be used for all references of this variable by SCSdescription - A short discription of this variableregistry - YoVariableRegistry with which this variable is to be registerdminScaling - minimum value for scaling purposesmaxScaling - maximum value for scaling purpousesYoVariableRegistry
public YoVariable(java.lang.String name,
YoVariableType type,
YoVariableRegistry registry)
name - name to be used for all references of this variable by SCStype - YoVariableType of this variable, can be an int, double, boolean or enum see YoVariableType for more informationregistry - YoVariableRegistry with which this variable is to be registerdYoVariableRegistry
public YoVariable(java.lang.String name,
java.lang.String description,
YoVariableType type,
YoVariableRegistry registry)
name - name to be used for all references of this variable by SCSdescription - A short discription of this variabletype - YoVariableType of this variable, can be an int, double, boolean or enum see YoVariableType for more informationregistry - YoVariableRegistry with which this variable is to be registeredYoVariableRegistry
public YoVariable(java.lang.String name,
java.lang.String description,
YoVariableType type,
YoVariableRegistry registry,
double minScaling,
double maxScaling)
name - name to be used for all references of this variable by SCSdescription - A short discription of this variabletype - YoVariableType of this variable, can be an int, double, boolean or enum see YoVariableType for more informationregistry - YoVariableRegistry with which this variable is to be registeredminScaling - minimum value for scaling purposesmaxScaling - maximum value for scaling purpousesYoVariableRegistry
public YoVariable(java.lang.String name,
java.lang.Enum[] enumeratorValues,
YoVariableRegistry registry)
name - name to be used for all references of this variable by SCSenumeratorValues - Enum[] array of enumerator values to be stored by this YoVariableregistry - YoVariableRegistry with which this variable is to be registered.YoVariableRegistry
public YoVariable(java.lang.String name,
java.lang.String description,
java.lang.Enum[] enumeratorValues,
YoVariableRegistry registry)
name - name to be used for all references of this variable by SCSdescription - a short descriptionenumeratorValues - Array of enumerator values to be contained by this YoVariableregistry - YoVariableRegistry| Method Detail |
|---|
public YoVariableRegistry getYoVariableRegistry()
public java.lang.String getName()
public java.lang.String getShortName()
public java.lang.String getDescription()
public void getName(java.lang.StringBuffer buffer)
buffer - StringBuffer to which the name will be added at the beginningpublic YoVariableType getYoVariableType()
public void setManualScalingMinMax(double minScaling,
double maxScaling)
minScaling - double representing the min scale valuemaxScaling - double representing the max scale valuepublic double getManualScalingMin()
public double getManualScalingMax()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean valueEquals(int value)
value - int to be compared
public boolean valueEquals(double value)
value - double to be compared
public boolean valueEquals(boolean value)
value - boolean to be compared to
public boolean valueEquals(java.lang.Enum value)
value - Enum to be compared
public java.lang.Enum getEnumValue()
public double getDoubleValue()
public boolean getBooleanValue()
public int getIntegerValue()
public void getNameAndValue(java.lang.StringBuffer stringBuffer)
stringBuffer - StringBuffer to which the data will be addedpublic void set(int value)
value - double value to storepublic void set(double value)
value - double value to storepublic void set(java.lang.Enum value)
value - Enum to store in this YoVariablepublic void set(boolean value)
value - booleanpublic void getValue(java.lang.StringBuffer stringBuffer)
stringBuffer - StringBuffer to which the value will be appendedpublic boolean fullNameEndsWith(java.lang.String name)
name - String
public boolean hasSameFullName(YoVariable variable)
variable - YoVariable
public java.lang.String getFullNameWithNameSpace()
public void addObserver(Observer observer)
Observable
addObserver in interface Observableobserver - the new observer to be addeddpublic void removeAllObservers()
Observable
removeAllObservers in interface Observablepublic void removeObserver(Observer observer)
Observable
removeObserver in interface Observableobserver - the new observer to be removedpublic void notifyObservers(Event event)
event - the event to communicate to the observers
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||