Class GeoprocessingLinearUnit
- java.lang.Object
-
- com.esri.arcgisruntime.tasks.geoprocessing.GeoprocessingParameter
-
- com.esri.arcgisruntime.tasks.geoprocessing.GeoprocessingLinearUnit
-
public final class GeoprocessingLinearUnit extends GeoprocessingParameter
Corresponds to GPLinearUnit parameter type in the service REST specification.
Geoprocessing tasks support a set of linear units defined inGeoprocessingLinearUnit.Unit
.When a linear unit parameter is created with one of the supported
GeoprocessingLinearUnit.Unit
the value is sent to the service using defined linear unit type.When a geoprocessing linear unit parameter is created with a
LinearUnit
, the value is converted to meters if the type is not supported. For example if the provided linear unit is international miles, the value is converted to meters since only US Survey Miles unit is supported in geoprocessing. After a geoprocessing linear unit is created, the used linear unit type can be checked by callinggetLinearUnit()
.When a geoprocessing linear unit is created with a supported linear unit, then no conversion takes place and the value is sent to the service using the defined type.
When a geoprocessing linear unit is returned as a output parameter, you can get the
LinearUnit
using thegetLinearUnit()
method.- Since:
- 100.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GeoprocessingLinearUnit.Unit
The list of geoprocessing linear unit types.-
Nested classes/interfaces inherited from class com.esri.arcgisruntime.tasks.geoprocessing.GeoprocessingParameter
GeoprocessingParameter.Type
-
-
Constructor Summary
Constructors Constructor Description GeoprocessingLinearUnit()
Creates an instance.GeoprocessingLinearUnit(double distance)
Creates an instance.GeoprocessingLinearUnit(double distance, LinearUnit linearUnit)
Creates an instance.GeoprocessingLinearUnit(double distance, LinearUnitId linearUnitId)
Creates an instance.GeoprocessingLinearUnit(double distance, GeoprocessingLinearUnit.Unit unit)
Creates an instance with a distance and a directly supported unit - no conversion will be applied to the distance value.GeoprocessingLinearUnit(LinearUnit linearUnit)
Creates an instance.GeoprocessingLinearUnit(LinearUnitId linearUnitId)
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getDistance()
Returns the distance value.LinearUnit
getLinearUnit()
Returns the linear unit that is used by the Geoprocessing service.GeoprocessingLinearUnit.Unit
getUnit()
Returns the unit.void
setDistance(double distance)
Sets the distance value.void
setUnit(GeoprocessingLinearUnit.Unit unit)
Sets the unit.
-
-
-
Constructor Detail
-
GeoprocessingLinearUnit
public GeoprocessingLinearUnit()
Creates an instance. Defaults to unit of meters and distance of 0.0.- Since:
- 100.0.0
-
GeoprocessingLinearUnit
public GeoprocessingLinearUnit(double distance)
Creates an instance. Defaults to unit of meters.- Parameters:
distance
- the distance value- Since:
- 100.0.0
-
GeoprocessingLinearUnit
public GeoprocessingLinearUnit(LinearUnit linearUnit)
Creates an instance. The distance defaults to 0.0. Note that if the given linear unit does not correspond to any of the values inGeoprocessingLinearUnit.Unit
, the unit will be changed to meters. UsegetLinearUnit()
to find out the actual unit being used and any distance set withsetDistance(double)
will be interpreted as being in that unit.- Parameters:
linearUnit
- the distance unit- Throws:
java.lang.IllegalArgumentException
- if linearUnit is null- Since:
- 100.0.0
-
GeoprocessingLinearUnit
public GeoprocessingLinearUnit(LinearUnitId linearUnitId)
Creates an instance. The distance defaults to 0.0. Note that if the given linear unit does not correspond to any of the values inGeoprocessingLinearUnit.Unit
, the unit will be changed to meters.- Parameters:
linearUnitId
- the distance unit- Throws:
java.lang.IllegalArgumentException
- if linearUnitId is null- Since:
- 100.0.0
-
GeoprocessingLinearUnit
public GeoprocessingLinearUnit(double distance, GeoprocessingLinearUnit.Unit unit)
Creates an instance with a distance and a directly supported unit - no conversion will be applied to the distance value.- Parameters:
distance
- the distance valueunit
- the unit- Throws:
java.lang.IllegalArgumentException
- if unit is null- Since:
- 100.0.0
-
GeoprocessingLinearUnit
public GeoprocessingLinearUnit(double distance, LinearUnit linearUnit)
Creates an instance. Note that if the given linear unit does not correspond to any of the values inGeoprocessingLinearUnit.Unit
, the unit will be changed to meters. This means that the distance property will return a different value to that set.- Parameters:
distance
- the distance valuelinearUnit
- the distance unit- Throws:
java.lang.IllegalArgumentException
- if linearUnit is null- Since:
- 100.0.0
-
GeoprocessingLinearUnit
public GeoprocessingLinearUnit(double distance, LinearUnitId linearUnitId)
Creates an instance. Note that if the given linear unit does not correspond to any of the values inGeoprocessingLinearUnit.Unit
, the unit will be changed to meters. This means that the distance property will return a different value to that set.- Parameters:
distance
- the distance valuelinearUnitId
- the ID of the distance unit- Throws:
java.lang.IllegalArgumentException
- if linearUnitId is null- Since:
- 100.0.0
-
-
Method Detail
-
getUnit
public GeoprocessingLinearUnit.Unit getUnit()
Returns the unit.- Returns:
- the unit
- Since:
- 100.0.0
-
getLinearUnit
public LinearUnit getLinearUnit()
Returns the linear unit that is used by the Geoprocessing service. This will be a linear unit that corresponds to an entry inGeoprocessingLinearUnit.Unit
.- Returns:
- the linear unit
- Since:
- 100.0.0
-
setUnit
public void setUnit(GeoprocessingLinearUnit.Unit unit)
Sets the unit. Changing the unit does not cause the distance value to be converted to the new unit.- Parameters:
unit
- the unit to set- Throws:
java.lang.IllegalArgumentException
- if linearUnit is null- Since:
- 100.0.0
-
getDistance
public double getDistance()
Returns the distance value.- Returns:
- the distance
- Since:
- 100.0.0
-
setDistance
public void setDistance(double distance)
Sets the distance value. The distance will be interpreted to be in the unit returned bygetLinearUnit()
.- Parameters:
distance
- the distance- Since:
- 100.0.0
-
-