com.esri.core.geometry
Class Unit

java.lang.Object
  extended by com.esri.core.geometry.Unit
Direct Known Subclasses:
AngularUnit, LinearUnit

public abstract class Unit
extends Object


Nested Class Summary
static class Unit.UnitType
           
 
Field Summary
protected  double m_factor
           
 
Constructor Summary
Unit()
           
 
Method Summary
static void convertUnits(double[] valueIn, int countIn, Unit unitFrom, Unit unitTo, double[] valueOut)
          Converts an array of values to new units of same UnitType.
static double convertUnits(double valueIn, Unit unitFrom, Unit unitTo)
          Converts input value to new units.
static Unit create(int wkid)
          Create a unit class from the well-known id(wkid).
abstract  String getAbbreviation()
          Returns abbreviated name of the unit.
abstract  double getConversionFactor(Unit destinationUnit)
          Returns a conversion factor from this unit to the destination unit.
abstract  String getDisplayName()
          Returns display name of the unit.
abstract  int getID()
          return The unit ID.
abstract  String getName()
          Returns canonical name of the unit as defined in Projection Engine (ex.
abstract  String getPluralDisplayName()
          Returns display name of the unit.
 double getUnitToBaseFactor()
          Conversion factor from this unit to the base unit (to SI meter for linear units, to radian for angular, and to SI square meter for area units).
abstract  Unit.UnitType getUnitType()
          Returns the unit type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_factor

protected double m_factor
Constructor Detail

Unit

public Unit()
Method Detail

getUnitType

public abstract Unit.UnitType getUnitType()
Returns the unit type.


create

public static Unit create(int wkid)
Create a unit class from the well-known id(wkid). The list of codes for common wkids can be found in the AngularUnitCode class and the LinearUnitCode class.

Parameters:
wkid -
Returns:
unit object of type Linear or Angular

getName

public abstract String getName()
Returns canonical name of the unit as defined in Projection Engine (ex. for German Meter the projection engine canonical string value is METER_GERMAN)

Returns:
string representation of Projection Engine unit name

getID

public abstract int getID()
return The unit ID. The ID value is a positive number for the units with well known IDs, and 0 for the custom and area units.

Returns:
Integer value for wkid

getDisplayName

public abstract String getDisplayName()
Returns display name of the unit.

Returns:
string value of unit display name

getPluralDisplayName

public abstract String getPluralDisplayName()
Returns display name of the unit.

Returns:
string value of plural display name

getAbbreviation

public abstract String getAbbreviation()
Returns abbreviated name of the unit.

Returns:
string value of abbreviation for unit

getConversionFactor

public abstract double getConversionFactor(Unit destinationUnit)
Returns a conversion factor from this unit to the destination unit. To convert a value V from this units to the dst units

Parameters:
destinationUnit -
Returns:
double conversion factor

convertUnits

public static double convertUnits(double valueIn,
                                  Unit unitFrom,
                                  Unit unitTo)
Converts input value to new units. Same as valueIn * unitFrom.getConversionFactor(unitTo);

Parameters:
valueIn - the value to be converted from unitFrom to unitTo
unitFrom -
unitTo -
Returns:
double the converted value

convertUnits

public static void convertUnits(double[] valueIn,
                                int countIn,
                                Unit unitFrom,
                                Unit unitTo,
                                double[] valueOut)
Converts an array of values to new units of same UnitType.

Parameters:
valueIn -
countIn -
unitFrom -
unitTo -
valueOut -

getUnitToBaseFactor

public double getUnitToBaseFactor()
Conversion factor from this unit to the base unit (to SI meter for linear units, to radian for angular, and to SI square meter for area units).



Copyright © 2010. All Rights Reserved.