|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vmm.core.Parameter vmm.core.ComplexParam
public class ComplexParam
A parameter of type Complex. The value object for a paremeter of this type belongs to the class Complex.
Constructor Summary | |
---|---|
ComplexParam()
Creates a ComplexParam that initially has no name and has value and default value equal to 0. |
|
ComplexParam(java.lang.String name,
Complex initialValue)
Create a ComplexParam with a specified name and initial value. |
|
ComplexParam(java.lang.String name,
java.lang.String valueAsString)
Create a ComplexParam with a specified name and initial value. |
Method Summary | |
---|---|
Complex |
getDefaultValue()
Returns the default value of this parameter. |
Complex |
getMaximumValueForInput()
Returns the maximum value that is allowed for this parameter when its value is input. |
Complex |
getMinimumValueForInput()
Returns the minimum value that is allowed for this parameter when its value is input. |
Complex |
getValue()
Returns the value of this object as a number of type Complex. |
void |
reset(Complex value)
Sets both the default value and the value of this parameter to the specified number. |
void |
setDefaultValue(double val)
Sets the default value of the parameter to a specified complex value. |
void |
setMaximumValueForInput(Complex maximumValueForInput)
Set the maximum value that is allowed for this parameter when its value is input. |
void |
setMinimumValueForInput(Complex minimumValueForInput)
Set the minimum value that is allowed for this parameter when its value is input. |
void |
setValue(Complex val)
Set the value of this parameter to a specified value of type Complex. |
void |
setValueAndDefault(Complex val)
Set both the value and the default value of this parameter to a specified int. |
protected java.lang.Object |
stringToValueObject(java.lang.String str)
Converts a string to an object of type Complex. |
protected java.lang.String |
valueObjectToString(java.lang.Object obj)
Returns a string representation of a value object of this Parameters. |
Methods inherited from class vmm.core.Parameter |
---|
createParameterInput, getDefaultValueAsString, getDefaultValueObject, getHint, getName, getOwner, getTitle, getValueAsString, getValueObject, reset, reset, setDefaultValueFromString, setDefaultValueObject, setName, setOwner, setValueAndDefaultFromString, setValueFromString, setValueObject, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ComplexParam()
public ComplexParam(java.lang.String name, Complex initialValue)
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()
.initialValue
- the initial value of the parameter. A null value is treated as 0public ComplexParam(java.lang.String name, java.lang.String valueAsString) throws java.lang.NumberFormatException
name
- The name of the Parameter.valueAsString
- The initial value of the parameter, given as a constant complex expression
that represents a legal value of type Complex. If this is not the case, a NumberFormatException is thrown.
This also becomes its default value.
java.lang.NumberFormatException
Method Detail |
---|
public void reset(Complex value)
The version in this class is essentially the same as setValueAndDefault(Complex)
,
but for animated parameters (defined by subclasses of this class), the animation start and
end values are also set.
value
- the new value and default value. A null value is treated as zero.Parameter.reset(String)
public void setValue(Complex val)
val
- the new value. A null value is treated as zero.Parameter.setValueObject(Object)
public Complex getValue()
Parameter.getValueObject()
public void setDefaultValue(double val)
AnimationLimitsDialog
.
val
- the default value. A null value is treated as zero.Parameter.setDefaultValueObject(Object)
public void setValueAndDefault(Complex val)
val
- the default value. A null value is treated as zero.public Complex getDefaultValue()
Parameter.getDefaultValueObject()
public Complex getMaximumValueForInput()
ParameterInput
.
setMaximumValueForInput(Complex)
public void setMaximumValueForInput(Complex maximumValueForInput)
ParameterInput
. The default value
is Double.POSITIVE_INFINITY + i*Double.POSITIVE_INFINITY, which means that there is no limit.
maximumValueForInput
- a Complex whose real part is the maximum allowed for the real part of the value of this parameter
and whose imaginary part is the maximum allowed for the imaginary part of this parameter. A null
value is changed to the default value, Double.POSITIVE_INFINITY + i*Double.POSITIVE_INFINITYpublic Complex getMinimumValueForInput()
ParameterInput
.
setMinimumValueForInput(Complex)
public void setMinimumValueForInput(Complex minimumValueForInput)
ParameterInput
. The default value
is Double.NEGATIVE_INFINITY + i*Double.NEGATIVE_INFINITY, which means that there is no limit. If you want to allow only strictly
positive numbers, set the value to Double.MIN_VALUE, which is the smallest positive number
that can be represented as a value of type double.
minimumValueForInput
- a Complex whose real part is the minimum allowed for the real part of the value of this parameter
and whose imaginary part is the minimum allowed for the imaginary part of this parameter. A null
value is changed to the default value, Double.NEGATIVE_INFINITY + i*Double.NEGATIVE_INFINITYprotected java.lang.Object stringToValueObject(java.lang.String str) throws java.lang.NumberFormatException
Exceptions to this are the special strings "##NAN##", "##INF##", "##NEGINF##", and ##EPSILON## which represent the numbers Double.NaN, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, and Double.MIN_VALUE. These strings are used when the parameter is written to an XML settings file. They are necessary since it is always possible to set a value programmatically to one of these numbers. These numbers are just not allowed as the value of an ordinary expression.
stringToValueObject
in class Parameter
str
- A string representation of a value for the parameter, possibly as a constant expression such as "2*pi"
java.lang.NumberFormatException
protected java.lang.String valueObjectToString(java.lang.Object obj)
Util.toExternalString(Object)
.
valueObjectToString
in class Parameter
obj
- A parameter value represented as an object.
Parameter.stringToValueObject(String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |