public class FloatParameter extends AbstractParameter implements ParameterValue<Double>
Parameter, except that:
double.
ParameterRealValue is slightly more efficient than ParameterValue since it avoid the creation of Double objects.DefaultParameterDescriptor,
ParameterGroup,
Serialized FormSINGLE_LINE| Constructor and Description |
|---|
FloatParameter(ParameterDescriptor<Double> descriptor)
Constructs a parameter from the specified descriptor.
|
FloatParameter(ParameterDescriptor<Double> descriptor,
double value)
Constructs a parameter from the specified descriptor and value.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
booleanValue()
Returns
true if the value is different from 0, false otherwise. |
FloatParameter |
clone()
Returns a clone of this parameter.
|
double |
doubleValue()
Returns the numeric value of the coordinate operation parameter with its associated
unit of measure.
|
double |
doubleValue(Unit<?> unit)
Returns the numeric value of the coordinate operation parameter in the specified unit of
measure.
|
double[] |
doubleValueList()
Wraps the value in an array of length 1.
|
double[] |
doubleValueList(Unit<?> unit)
Wraps the value in an array of length 1.
|
boolean |
equals(Object object)
Compares the specified object with this parameter for equality.
|
ParameterDescriptor<Double> |
getDescriptor()
Returns the abstract definition of this parameter.
|
Unit<?> |
getUnit()
Returns the unit of measure of the parameter value.
|
Double |
getValue()
Returns the parameter value as {
Double, |
int |
hashCode()
Returns a hash value for this parameter.
|
int |
intValue()
Returns the numeric value rounded to the nearest integer.
|
int[] |
intValueList()
Wraps the value in an array of length 1.
|
void |
setValue(boolean value)
Set the parameter value as a boolean.
|
void |
setValue(double value)
Set the parameter value as a floating point.
|
void |
setValue(double[] values,
Unit<?> unit)
Always throws an exception, since this parameter is not an array.
|
void |
setValue(double value,
Unit<?> unit)
Set the parameter value as a floating point and its associated unit.
|
void |
setValue(int value)
Set the parameter value as an integer.
|
void |
setValue(Object value)
Set the parameter value as a
Double object. |
String |
stringValue()
Returns the string representation of the value.
|
URI |
valueFile()
Always throws an exception, since this parameter is not an URI.
|
formatWKT, toString, writecleanupThreadLocals, toWKT, toWKT, toWKT, toWKTpublic FloatParameter(ParameterDescriptor<Double> descriptor)
Double.class
.descriptor - The abstract definition of this parameter.IllegalArgumentException - if the value class is not Double.class.public FloatParameter(ParameterDescriptor<Double> descriptor, double value)
setValue(double).descriptor - The abstract definition of this parameter.value - The parameter value.IllegalArgumentException - if the value class is not Double.class.public ParameterDescriptor<Double> getDescriptor()
getDescriptor in interface GeneralParameterValuegetDescriptor in interface ParameterValue<Double>getDescriptor in class AbstractParameterpublic Unit<?> getUnit()
ParameterDescriptor.getUnit().getUnit in interface ParameterValue<Double>null if none.ParameterValue.doubleValue(),
ParameterValue.doubleValueList(javax.measure.Unit<?>),
ParameterValue.getValue()public double doubleValue(Unit<?> unit)
throws IllegalArgumentException
doubleValue in interface ParameterValue<Double>unit - The unit of measure for the value to be returned.double and conversion to unit.IllegalArgumentException - if the specified unit is invalid for this parameter.ParameterValue.getUnit(),
ParameterValue.setValue(double,Unit),
ParameterValue.doubleValueList(Unit)public double doubleValue()
doubleValue in interface ParameterValue<Double>double.ParameterValue.getUnit(),
ParameterValue.setValue(double),
ParameterValue.doubleValueList(javax.measure.Unit<?>)public int intValue()
intValue in interface ParameterValue<Double>int.ParameterValue.setValue(int),
ParameterValue.intValueList()public boolean booleanValue()
true if the value is different from 0, false otherwise.booleanValue in interface ParameterValue<Double>ParameterValue.setValue(boolean)public String stringValue()
stringValue in interface ParameterValue<Double>ParameterValue.getValue(),
ParameterValue.setValue(Object)public double[] doubleValueList(Unit<?> unit)
throws IllegalArgumentException
doubleValueList in interface ParameterValue<Double>unit - The unit of measure for the value to be returned.double and conversion to unit.IllegalArgumentException - if the specified unit is invalid for this parameter.ParameterValue.getUnit(),
ParameterValue.setValue(double[],Unit),
ParameterValue.doubleValue(Unit)public double[] doubleValueList()
doubleValueList in interface ParameterValue<Double>ParameterValue.getUnit(),
ParameterValue.setValue(Object),
ParameterValue.doubleValue()public int[] intValueList()
intValueList in interface ParameterValue<Double>ParameterValue.setValue(Object),
ParameterValue.intValue()public URI valueFile() throws InvalidParameterTypeException
valueFile in interface ParameterValue<Double>InvalidParameterTypeException - The value is not a reference to a file or an URI.ParameterValue.getValue(),
ParameterValue.setValue(Object)public Double getValue()
Double,getValue in interface ParameterValue<Double>ParameterValue.setValue(Object)public void setValue(double value,
Unit<?> unit)
throws InvalidParameterValueException
setValue in interface ParameterValue<Double>value - The parameter value.unit - The unit for the specified value.InvalidParameterValueException - if the value is illegal for some reason (for example a
value out of range).ParameterValue.setValue(double),
ParameterValue.doubleValue(Unit)public void setValue(double value)
throws InvalidParameterValueException
setValue in interface ParameterValue<Double>value - The parameter value.InvalidParameterValueException - if the value is illegal for some reason (for example a
value out of range).ParameterValue.setValue(double,Unit),
ParameterValue.doubleValue()public void setValue(int value)
throws InvalidParameterValueException
setValue in interface ParameterValue<Double>value - The parameter value.InvalidParameterValueException - if the value is illegal for some reason (for example a
value out of range).ParameterValue.intValue()public void setValue(boolean value)
throws InvalidParameterValueException
setValue in interface ParameterValue<Double>value - The parameter value.InvalidParameterValueException - if the boolean type is inappropriate for this
parameter.ParameterValue.booleanValue()public void setValue(Object value) throws InvalidParameterValueException
Double object.setValue in interface ParameterValue<Double>value - The parameter value.InvalidParameterValueException - if the type of value is inappropriate for this
parameter, or if the value is illegal for some other reason (for example the value is
numeric and out of range).ParameterValue.getValue()public void setValue(double[] values,
Unit<?> unit)
throws InvalidParameterValueException
setValue in interface ParameterValue<Double>values - The parameter values.unit - The unit for the specified value.InvalidParameterValueException - if the floating point type is inappropriate for this
parameter, or if the value is illegal for some other reason (for example a value out of
range).public boolean equals(Object object)
equals in class AbstractParameterobject - The object to compare to this.true if both objects are equal.public int hashCode()
hashCode in class AbstractParameterpublic FloatParameter clone()
clone in interface GeneralParameterValueclone in interface ParameterValue<Double>clone in class AbstractParameterObject.clone()Copyright © 1996–2019 Geotools. All rights reserved.