com.esri.arcgis.system
Class UnitConverter

java.lang.Object
  extended by com.esri.arcgis.system.UnitConverter
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, IUnitConverter, Serializable

public class UnitConverter
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IUnitConverter

Helper CoClass to convert units.

Description

The UnitCoverter Class provides methods for converting values between different units of measure, and converting units to strings.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

See Also:
Serialized Form

Constructor Summary
UnitConverter()
          Constructs a UnitConverter using ArcGIS Engine.
UnitConverter(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
UnitConverter theUnitConverter = (UnitConverter) obj;
 
Method Summary
 double convertUnits(double dValue, int inUnits, int outUnits)
          Convert ESRI units.
 boolean equals(Object o)
          Compare this object with another
 String esriUnitsAsString(int units, int appearance, boolean bPlural)
          Convert ESRI unit enumerations to strings.
static String getClsid()
          getClsid.
 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

UnitConverter

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

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

UnitConverter

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

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

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

convertUnits

public double convertUnits(double dValue,
                           int inUnits,
                           int outUnits)
                    throws IOException,
                           AutomationException
Convert ESRI units.

Description

Converts the specified numeric data value from one unit of measure to another unit of measure.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
convertUnits in interface IUnitConverter
Parameters:
dValue - The dValue (in)
inUnits - A com.esri.arcgis.system.esriUnits constant (in)
outUnits - A com.esri.arcgis.system.esriUnits constant (in)
Returns:
The outValue
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

esriUnitsAsString

public String esriUnitsAsString(int units,
                                int appearance,
                                boolean bPlural)
                         throws IOException,
                                AutomationException
Convert ESRI unit enumerations to strings.

Description

Converts the specified units to a string. Specify the case (eg. lower or upper case) of the string and whether the string specifies a single unit or many unit(s).

The EsriUnitsAsString method is useful for providing text to the user interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
esriUnitsAsString in interface IUnitConverter
Parameters:
units - A com.esri.arcgis.system.esriUnits constant (in)
appearance - A com.esri.arcgis.system.esriCaseAppearance constant (in)
bPlural - The bPlural (in)
Returns:
The sUnitString
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.