|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vmm.core.Parameter vmm.core.RealParam vmm.core.VariableParam
public class VariableParam
A real-valued parameter whose value is also the value of a Variable, as defined in
the class Variable
. When the value of the parameter is
changed, the value of the variable is changed to match, and vice-versa.
Parameters of this type are mostly for use in user-defined objects. The
name of a VariableParam is shared with the associated variable and therefor should probably
be of human-readable form, such as "a" or "b".
Constructor Summary | |
---|---|
VariableParam()
Creates a VariableParam that initially has no name and has value and default value equal to 0. |
|
VariableParam(java.lang.String name,
double initialValue)
Create a VariableParam with a specified name and initial value. |
|
VariableParam(java.lang.String name,
java.lang.String value)
Create a VariableParam with a specified name and initial value, where the initial value is given as a string. |
|
VariableParam(Variable v)
Create a VariableParam that will share the value of the specified variable. |
Method Summary | |
---|---|
java.lang.Object |
getValueObject()
Get the value object of this parameter. |
Variable |
getVariable()
Returns the non-null variable associated with this VariableParam. |
void |
setName(java.lang.String name)
Sets the name of this parameter and of the associated variable. |
void |
setValueObject(java.lang.Object object)
Sets the value of this parameter and of the associated variable. |
Methods inherited from class vmm.core.RealParam |
---|
getDefaultValue, getMaximumValueForInput, getMinimumValueForInput, getValue, reset, setDefaultValue, setMaximumValueForInput, setMinimumValueForInput, setValue, setValueAndDefault, stringToValueObject, valueObjectToString |
Methods inherited from class vmm.core.Parameter |
---|
createParameterInput, getDefaultValueAsString, getDefaultValueObject, getHint, getName, getOwner, getTitle, getValueAsString, reset, reset, setDefaultValueFromString, setDefaultValueObject, setOwner, setValueAndDefaultFromString, setValueFromString, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public VariableParam()
public VariableParam(java.lang.String name, double initialValue)
getVariable()
method.
name
- The name of the Parameter, which can be null but ordinarily should not be.
The name shoud identify the Parameter uniquely among parameters associated with a given
Parameterizeable object. The name is for internal use in VMM. A human-readable name
is returned by Parameter.getTitle()
. The name also becomes the name of the associated
variable.initialValue
- The initial value of the parameter. This also becomes its default value.public VariableParam(java.lang.String name, java.lang.String value) throws java.lang.NumberFormatException
getVariable()
method.
name
- The name of the Parameter.value
- The initial value of the parameter, given as a constant expression
that represents a legal value of type double. If this is not the case, a NumberFormatException is thrown.
This also becomes its default value.
java.lang.NumberFormatException
public VariableParam(Variable v)
v
- the non-null variable that will be associated with the VariableParamMethod Detail |
---|
public void setName(java.lang.String name)
setName
in class Parameter
public void setValueObject(java.lang.Object object)
setValueObject
in class Parameter
object
- The new value of this parameter. The value is set without checking whether
the value is of the correct type for this parameter. A type-cast error might result
at some later time. Subclasses might override this method to guarantee that the
object is of the correct type.public java.lang.Object getValueObject()
setVal
method.
getValueObject
in class Parameter
public Variable getVariable()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |