vmm3d.core
Class RealParam
- java.lang.Object
-
- vmm3d.core.Parameter
-
- vmm3d.core.RealParam
-
- Direct Known Subclasses:
- RealParamAnimateable, VariableParam
public class RealParam extends Parameter
A parameter of type Real. The value object for a paremeter of this type belongs to the class Double.
-
-
Constructor Summary
Constructors Constructor and Description RealParam()Creates a RealParam that initially has no name and has value and default value equal to 0.RealParam(java.lang.String name, double initialValue)Create a RealParam with a specified name and initial value.RealParam(java.lang.String name, java.lang.String valueAsString)Create a RealParam with a specified name and initial value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetDefaultValue()Returns the default value of this parameter as an int.doublegetMaximumValueForInput()Returns the maximum value that is allowed for this parameter when its value is input.doublegetMinimumValueForInput()Returns the minimum value that is allowed for this parameter when its value is input.doublegetValue()Returns the value of this object as a number of type double.voidreset(double 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 double.voidsetMaximumValueForInput(double maximumValueForInput)Set the maximum value that is allowed for this parameter when its value is input.voidsetMinimumValueForInput(double minimumValueForInput)Set the minimum value that is allowed for this parameter when its value is input.voidsetValue(double val)Set the value of this parameter to a specified value of type double.voidsetValueAndDefault(double 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
-
RealParam
public RealParam()
Creates a RealParam that initially has no name and has value and default value equal to 0.
-
RealParam
public RealParam(java.lang.String name, double initialValue)Create a RealParam 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. This also becomes its default value.
-
RealParam
public RealParam(java.lang.String name, java.lang.String valueAsString) throws java.lang.NumberFormatExceptionCreate a RealParam 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 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.- Throws:
java.lang.NumberFormatException
-
-
Method Detail
-
reset
public void reset(double 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(double), but for animated parameters (defined by subclasses of this class), the animation start and end values are also set.- See Also:
Parameter.reset(String)
-
setValue
public void setValue(double val)
Set the value of this parameter to a specified value of type double.- See Also:
Parameter.setValueObject(Object)
-
getValue
public double getValue()
Returns the value of this object as a number of type double.- See Also:
Parameter.getValueObject()
-
setDefaultValue
public void setDefaultValue(double val)
Sets the default value of the parameter to a specified double. The default value is used when the user clicks the "Defaults" button in anAnimationLimitsDialog.- See Also:
Parameter.setDefaultValueObject(Object)
-
setValueAndDefault
public void setValueAndDefault(double val)
Set both the value and the default value of this parameter to a specified int.
-
getDefaultValue
public double getDefaultValue()
Returns the default value of this parameter as an int.- See Also:
Parameter.getDefaultValueObject()
-
getMaximumValueForInput
public double 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.- See Also:
setMaximumValueForInput(double)
-
setMaximumValueForInput
public void setMaximumValueForInput(double 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.NEGATIVE_INFINITY, which means that there is no limit.
-
getMinimumValueForInput
public double 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.- See Also:
setMinimumValueForInput(double)
-
setMinimumValueForInput
public void setMinimumValueForInput(double 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, 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.
-
-
DMelt 3.0 © DataMelt by jWork.ORG