|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectFormattableObject
AbstractParameter
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.
When those conditions are meet, FloatParameter is slightly more efficient
than Parameter since it avoid the creation of Double wrapper objects.
DefaultParameterDescriptor,
ParameterGroup,
Serialized Form
| referencing/geotk-referencing (download) | View source code for this class |
| Field Summary |
|---|
| Fields inherited from class FormattableObject |
|---|
EPSG, GEOTIFF, INTERNAL, OGC, SINGLE_LINE |
| Constructor Summary | |
|---|---|
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. |
|
| 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(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)
Sets the parameter value as a boolean. |
void |
setValue(double value)
Sets 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)
Sets the parameter value as a floating point and its associated unit. |
void |
setValue(int value)
Sets the parameter value as an integer. |
void |
setValue(Object value)
Sets 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. |
| Methods inherited from class AbstractParameter |
|---|
formatWKT, toString, write |
| Methods inherited from class FormattableObject |
|---|
getDefaultIndentation, print, setDefaultIndentation, toWKT, toWKT, toWKT |
| Methods inherited from class Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FloatParameter(ParameterDescriptor<Double> descriptor)
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.| Method Detail |
|---|
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.
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.public double doubleValue()
doubleValue in interface ParameterValue<Double>double.public int intValue()
intValue in interface ParameterValue<Double>int.public boolean booleanValue()
true if the value is different from 0, false otherwise.
booleanValue in interface ParameterValue<Double>public String stringValue()
stringValue in interface ParameterValue<Double>
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.public double[] doubleValueList()
doubleValueList in interface ParameterValue<Double>public int[] intValueList()
intValueList in interface ParameterValue<Double>
public URI valueFile()
throws InvalidParameterTypeException
valueFile in interface ParameterValue<Double>InvalidParameterTypeException - The value is not a reference to a file or an URI.public Double getValue()
Double,
getValue in interface ParameterValue<Double>
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).
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).
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).
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.
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).
public void setValue(double[] values,
Unit<?> unit)
throws InvalidParameterValueException
setValue in interface ParameterValue<Double>InvalidParameterValueExceptionpublic 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 AbstractParameter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||