vmm3d.core
Class ComplexParam
- java.lang.Object
-
- vmm3d.core.Parameter
-
- vmm3d.core.ComplexParam
-
- Direct Known Subclasses:
- ComplexParamAnimateable, ComplexVariableParam
public class ComplexParam extends Parameter
A parameter of type Complex. The value object for a paremeter of this type belongs to the class Complex.
-
-
Constructor Summary
Constructors Constructor and Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description ComplexgetDefaultValue()Returns the default value of this parameter.ComplexgetMaximumValueForInput()Returns the maximum value that is allowed for this parameter when its value is input.ComplexgetMinimumValueForInput()Returns the minimum value that is allowed for this parameter when its value is input.ComplexgetValue()Returns the value of this object as a number of type Complex.voidreset(Complex value)Sets both the default value and the value of this parameter to the specified number.voidsetDefaultValue(double val)Sets the default value of the parameter to a specified complex value.voidsetMaximumValueForInput(Complex maximumValueForInput)Set the maximum value that is allowed for this parameter when its value is input.voidsetMinimumValueForInput(Complex minimumValueForInput)Set the minimum value that is allowed for this parameter when its value is input.voidsetValue(Complex val)Set the value of this parameter to a specified value of type Complex.voidsetValueAndDefault(Complex val)Set both the value and the default value of this parameter to a specified int.-
Methods inherited from class vmm3d.core.Parameter
createParameterInput, getDefaultValueAsString, getDefaultValueObject, getHint, getName, getOwner, getTitle, getValueAsString, getValueObject, reset, setDefaultValueFromString, setDefaultValueObject, setName, setOwner, setValueAndDefaultFromString, setValueFromString, setValueObject, toString
-
-
-
-
Constructor Detail
-
ComplexParam
public ComplexParam()
Creates a ComplexParam that initially has no name and has value and default value equal to 0.
-
ComplexParam
public ComplexParam(java.lang.String name, Complex initialValue)Create a ComplexParam with a specified name and initial value.- Parameters:
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 byParameter.getTitle().initialValue- the initial value of the parameter. A null value is treated as 0
-
ComplexParam
public ComplexParam(java.lang.String name, java.lang.String valueAsString) throws java.lang.NumberFormatExceptionCreate a ComplexParam with a specified name and initial value.- Parameters:
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.- Throws:
java.lang.NumberFormatException
-
-
Method Detail
-
reset
public void reset(Complex value)
Sets both the default value and the value of this parameter to the specified number. This is primarily meant to be called in the constructor of an Exhibit when it wants to change the value of a parameter that is inherited from a superclass.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.- Parameters:
value- the new value and default value. A null value is treated as zero.- See Also:
Parameter.reset(String)
-
setValue
public void setValue(Complex val)
Set the value of this parameter to a specified value of type Complex.- Parameters:
val- the new value. A null value is treated as zero.- See Also:
Parameter.setValueObject(Object)
-
getValue
public Complex getValue()
Returns the value of this object as a number of type Complex.- See Also:
Parameter.getValueObject()
-
setDefaultValue
public void setDefaultValue(double val)
Sets the default value of the parameter to a specified complex value. The default value is used when the user clicks the "Defaults" button in anAnimationLimitsDialog.- Parameters:
val- the default value. A null value is treated as zero.- See Also:
Parameter.setDefaultValueObject(Object)
-
setValueAndDefault
public void setValueAndDefault(Complex val)
Set both the value and the default value of this parameter to a specified int.- Parameters:
val- the default value. A null value is treated as zero.
-
getDefaultValue
public Complex getDefaultValue()
Returns the default value of this parameter.- See Also:
Parameter.getDefaultValueObject()
-
getMaximumValueForInput
public Complex getMaximumValueForInput()
Returns the maximum value that is allowed for this parameter when its value is input. In the VMM core, this limit is only enforced when the value is input into aParameterInput.- Returns:
- 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.
- See Also:
setMaximumValueForInput(Complex)
-
setMaximumValueForInput
public void setMaximumValueForInput(Complex maximumValueForInput)
Set the maximum value that is allowed for this parameter when its value is input. In the VMM core, this limit is only enforced when the value is input into aParameterInput. The default value is Double.POSITIVE_INFINITY + i*Double.POSITIVE_INFINITY, which means that there is no limit.- Parameters:
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_INFINITY
-
getMinimumValueForInput
public Complex getMinimumValueForInput()
Returns the minimum value that is allowed for this parameter when its value is input. In the VMM core, this limit is only enforced when the value is input into aParameterInput.- Returns:
- 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.
- See Also:
setMinimumValueForInput(Complex)
-
setMinimumValueForInput
public void setMinimumValueForInput(Complex minimumValueForInput)
Set the minimum value that is allowed for this parameter when its value is input. In the VMM core, this limit is only enforced when the value is input into aParameterInput. 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.- Parameters:
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_INFINITY
-
-
DMelt 3.0 © DataMelt by jWork.ORG