com.esri.arcgis.editor
Class DistanceConverter

java.lang.Object
  extended by com.esri.arcgis.editor.DistanceConverter
All Implemented Interfaces:
IDistanceConverter, IDistanceConverter2, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class DistanceConverter
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IDistanceConverter2

Converts distance values from one unit to another.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

See Also:
Serialized Form

Constructor Summary
DistanceConverter()
          Constructs a DistanceConverter using ArcGIS Engine.
DistanceConverter(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
DistanceConverter theDistanceConverter = (DistanceConverter) obj;
 
Method Summary
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 double getValue(String val, ISpatialReference pUnits)
          Converts the string value to a double.
 double getValueForLinearUnit(String val, ILinearUnit pUnit)
          Converts the string value to the given desired linear unit.
 int hashCode()
          the hashcode for this object
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

DistanceConverter

public DistanceConverter()
                  throws IOException,
                         UnknownHostException
Constructs a DistanceConverter using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

DistanceConverter

public DistanceConverter(Object obj)
                  throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
DistanceConverter theDistanceConverter = (DistanceConverter) obj;

Construct a DistanceConverter using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to DistanceConverter.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

getValueForLinearUnit

public double getValueForLinearUnit(String val,
                                    ILinearUnit pUnit)
                             throws IOException,
                                    AutomationException
Converts the string value to the given desired linear unit.

Product Availability

Available with ArcGIS Desktop.

Specified by:
getValueForLinearUnit in interface IDistanceConverter2
Parameters:
val - The val (in)
pUnit - A reference to a com.esri.arcgis.geometry.ILinearUnit (in)
Returns:
The pVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getValue

public double getValue(String val,
                       ISpatialReference pUnits)
                throws IOException,
                       AutomationException
Converts the string value to a double.

Remarks

GetValue returns a Double value that is a converted distance from the input string. The input string is formatted that combines a distance value and a suffix abbreviation of the distance units. A spatial reference is used to determine the output distance units.

The following list of suffixes can be used:

Metric Units:

Distance Units Abbrev. Meters per Unit Description
Kilometer km 1000 1000 meters exactly
Meter m 1 International meter.
Millimeter mm 0.001 1/1000 meters exactly

Imperial or international units:

Distance Units Abbrev. Meters per Unit Description
Foot ft 0.3048 Standard foot in the US. Also known as international foot or imperial foot that was used in most non-US countries before the metric system.
Mile mi 1609.344 Also referred to a statute mile, equal to 5280 international feet.
Nautical mile nm 1852 The nautical mile is a unit of distance used primarily in sea and in aviation.
Chain ch 20.1168 66 international feet.
Yard yd 0.9144 Three international feet.
Rod rd 5.0292 1/4 chain or 16.5 international feet.
Link lk 0.201168 1/100 international chain or 66/100 international feet.
Inch in 0.0254 1/12 of an international foot.
US survey units:
Distance Units Abbrev. Meters per Unit Description
Survey foot ftus ~0.3048006 The US survey foot is used in the State Plane Coordinate Systems. An exact conversion is accomplished by multiplying US survey feet by the fraction 1200/3937.
Survey mile mius ~1609.347219 5280 survey feet.
Survey chain chus ~20.116840 66 survey feet.
Survey rod rdus ~5.029210 1/4 survey chain.
Survey link lkus ~0.201168 1/100 survey chain.
Survey yard ydus ~0.914402 3 survey feet.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getValue in interface IDistanceConverter
Parameters:
val - The val (in)
pUnits - A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
Returns:
The pVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.