|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.referencing.wkt.Formattable
org.geotools.parameter.AbstractParameter
org.geotools.parameter.FloatParameter
public class FloatParameter
A parameter value as a floating point (double precision) number.
This class provides the same functionalities than Parameter
, except that:
double
.ParameterRealValue
is slightly more efficient
than ParameterValue
since it avoid the creation of Double
objects.
DefaultParameterDescriptor
,
ParameterGroup
,
Serialized FormField Summary |
---|
Fields inherited from class org.geotools.referencing.wkt.Formattable |
---|
SINGLE_LINE |
Constructor Summary | |
---|---|
FloatParameter(org.opengis.parameter.ParameterDescriptor<java.lang.Double> descriptor)
Constructs a parameter from the specified descriptor. |
|
FloatParameter(org.opengis.parameter.ParameterDescriptor<java.lang.Double> descriptor,
double value)
Constructs a parameter from the specified descriptor and value. |
Method Summary | |
---|---|
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(javax.measure.unit.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(javax.measure.unit.Unit<?> unit)
Wraps the value in an array of length 1. |
boolean |
equals(java.lang.Object object)
Compares the specified object with this parameter for equality. |
org.opengis.parameter.ParameterDescriptor<java.lang.Double> |
getDescriptor()
Returns the abstract definition of this parameter. |
javax.measure.unit.Unit<?> |
getUnit()
Returns the unit of measure of the parameter value. |
java.lang.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,
javax.measure.unit.Unit<?> unit)
Always throws an exception, since this parameter is not an array. |
void |
setValue(double value,
javax.measure.unit.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(java.lang.Object value)
Set the parameter value as a Double object. |
java.lang.String |
stringValue()
Returns the string representation of the value. |
java.net.URI |
valueFile()
Always throws an exception, since this parameter is not an URI. |
Methods inherited from class org.geotools.parameter.AbstractParameter |
---|
formatWKT, toString, write |
Methods inherited from class org.geotools.referencing.wkt.Formattable |
---|
cleanupThreadLocals, toWKT, toWKT, toWKT |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FloatParameter(org.opengis.parameter.ParameterDescriptor<java.lang.Double> descriptor)
Double.class
.
descriptor
- The abstract definition of this parameter.
java.lang.IllegalArgumentException
- if the value class is not Double.class
.public FloatParameter(org.opengis.parameter.ParameterDescriptor<java.lang.Double> descriptor, double value)
setValue(double)
.
descriptor
- The abstract definition of this parameter.value
- The parameter value.
java.lang.IllegalArgumentException
- if the value class is not Double.class
.Method Detail |
---|
public org.opengis.parameter.ParameterDescriptor<java.lang.Double> getDescriptor()
getDescriptor
in interface org.opengis.parameter.GeneralParameterValue
getDescriptor
in interface org.opengis.parameter.ParameterValue<java.lang.Double>
getDescriptor
in class AbstractParameter
public javax.measure.unit.Unit<?> getUnit()
ParameterDescriptor.getUnit()
.
getUnit
in interface org.opengis.parameter.ParameterValue<java.lang.Double>
null
if none.public double doubleValue(javax.measure.unit.Unit<?> unit) throws java.lang.IllegalArgumentException
doubleValue
in interface org.opengis.parameter.ParameterValue<java.lang.Double>
unit
- The unit of measure for the value to be returned.
double
and conversion to unit
.
java.lang.IllegalArgumentException
- if the specified unit is invalid for this parameter.public double doubleValue()
doubleValue
in interface org.opengis.parameter.ParameterValue<java.lang.Double>
double
.public int intValue()
intValue
in interface org.opengis.parameter.ParameterValue<java.lang.Double>
int
.public boolean booleanValue()
true
if the value is different from 0, false
otherwise.
booleanValue
in interface org.opengis.parameter.ParameterValue<java.lang.Double>
public java.lang.String stringValue()
stringValue
in interface org.opengis.parameter.ParameterValue<java.lang.Double>
public double[] doubleValueList(javax.measure.unit.Unit<?> unit) throws java.lang.IllegalArgumentException
doubleValueList
in interface org.opengis.parameter.ParameterValue<java.lang.Double>
unit
- The unit of measure for the value to be returned.
double
and conversion to unit
.
java.lang.IllegalArgumentException
- if the specified unit is invalid for this parameter.public double[] doubleValueList()
doubleValueList
in interface org.opengis.parameter.ParameterValue<java.lang.Double>
public int[] intValueList()
intValueList
in interface org.opengis.parameter.ParameterValue<java.lang.Double>
public java.net.URI valueFile() throws org.opengis.parameter.InvalidParameterTypeException
valueFile
in interface org.opengis.parameter.ParameterValue<java.lang.Double>
org.opengis.parameter.InvalidParameterTypeException
- The value is not a reference to a file or an URI.public java.lang.Double getValue()
Double
,
getValue
in interface org.opengis.parameter.ParameterValue<java.lang.Double>
public void setValue(double value, javax.measure.unit.Unit<?> unit) throws org.opengis.parameter.InvalidParameterValueException
setValue
in interface org.opengis.parameter.ParameterValue<java.lang.Double>
value
- The parameter value.unit
- The unit for the specified value.
org.opengis.parameter.InvalidParameterValueException
- if the value is illegal for some reason
(for example a value out of range).public void setValue(double value) throws org.opengis.parameter.InvalidParameterValueException
setValue
in interface org.opengis.parameter.ParameterValue<java.lang.Double>
value
- The parameter value.
org.opengis.parameter.InvalidParameterValueException
- if the value is illegal for some reason
(for example a value out of range).public void setValue(int value) throws org.opengis.parameter.InvalidParameterValueException
setValue
in interface org.opengis.parameter.ParameterValue<java.lang.Double>
value
- The parameter value.
org.opengis.parameter.InvalidParameterValueException
- if the value is illegal for some reason
(for example a value out of range).public void setValue(boolean value) throws org.opengis.parameter.InvalidParameterValueException
setValue
in interface org.opengis.parameter.ParameterValue<java.lang.Double>
value
- The parameter value.
org.opengis.parameter.InvalidParameterValueException
- if the boolean type is inappropriate for this parameter.public void setValue(java.lang.Object value) throws org.opengis.parameter.InvalidParameterValueException
Double
object.
setValue
in interface org.opengis.parameter.ParameterValue<java.lang.Double>
value
- The parameter value.
org.opengis.parameter.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).public void setValue(double[] values, javax.measure.unit.Unit<?> unit) throws org.opengis.parameter.InvalidParameterValueException
setValue
in interface org.opengis.parameter.ParameterValue<java.lang.Double>
org.opengis.parameter.InvalidParameterValueException
public boolean equals(java.lang.Object object)
equals
in class AbstractParameter
object
- The object to compare to this
.
true
if both objects are equal.public int hashCode()
hashCode
in class AbstractParameter
public FloatParameter clone()
clone
in interface org.opengis.parameter.GeneralParameterValue
clone
in interface org.opengis.parameter.ParameterValue<java.lang.Double>
clone
in class AbstractParameter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |