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.Unitthe 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 LinearUnitusing thegetLinearUnit()method.- Since:
- 100.0.0
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classGeoprocessingLinearUnit.UnitThe list of geoprocessing linear unit types.- 
Nested classes/interfaces inherited from class com.esri.arcgisruntime.tasks.geoprocessing.GeoprocessingParameterGeoprocessingParameter.Type
 
- 
 - 
Constructor SummaryConstructors 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 SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetDistance()Returns the distance value.LinearUnitgetLinearUnit()Returns the linear unit that is used by the Geoprocessing service.GeoprocessingLinearUnit.UnitgetUnit()Returns the unit.voidsetDistance(double distance)Sets the distance value.voidsetUnit(GeoprocessingLinearUnit.Unit unit)Sets the unit.
 
- 
- 
- 
Constructor Detail- 
GeoprocessingLinearUnitpublic GeoprocessingLinearUnit() Creates an instance. Defaults to unit of meters and distance of 0.0.- Since:
- 100.0.0
 
 - 
GeoprocessingLinearUnitpublic GeoprocessingLinearUnit(double distance) Creates an instance. Defaults to unit of meters.- Parameters:
- distance- the distance value
- Since:
- 100.0.0
 
 - 
GeoprocessingLinearUnitpublic 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
 
 - 
GeoprocessingLinearUnitpublic 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
 
 - 
GeoprocessingLinearUnitpublic 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 value
- unit- the unit
- Throws:
- java.lang.IllegalArgumentException- if unit is null
- Since:
- 100.0.0
 
 - 
GeoprocessingLinearUnitpublic 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 value
- linearUnit- the distance unit
- Throws:
- java.lang.IllegalArgumentException- if linearUnit is null
- Since:
- 100.0.0
 
 - 
GeoprocessingLinearUnitpublic 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 value
- linearUnitId- the ID of the distance unit
- Throws:
- java.lang.IllegalArgumentException- if linearUnitId is null
- Since:
- 100.0.0
 
 
- 
 - 
Method Detail- 
getUnitpublic GeoprocessingLinearUnit.Unit getUnit() Returns the unit.- Returns:
- the unit
- Since:
- 100.0.0
 
 - 
getLinearUnitpublic 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
 
 - 
setUnitpublic 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
 
 - 
getDistancepublic double getDistance() Returns the distance value.- Returns:
- the distance
- Since:
- 100.0.0
 
 - 
setDistancepublic 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
 
 
- 
 
-