FRAMES2API
Class Conversion

java.lang.Object
  extended by FRAMES2API.Conversion

public class Conversion
extends java.lang.Object


Nested Class Summary
static class Conversion.ByReferenceBoolean
           
static class Conversion.ByReferenceDouble
           
static class Conversion.ByReferenceInteger
           
static class Conversion.ByReferenceLong
           
static class Conversion.ByReferenceString
           
 
Constructor Summary
Conversion()
           
 
Method Summary
 int AddMeasure(java.lang.String Measure, java.lang.String BaseUnit, java.lang.String BaseUnitAbbr)
          Documentation for: AddMeasure Add a new measure to the set of measures.
 int AddUnit(java.lang.String Measure, java.lang.String Unit, java.lang.String UnitAbbr, double Factor, double Offset)
          Documentation for: AddUnit Add a new Unit within a measure.
 int DelMeasure(java.lang.String Measure)
          Documentation for: DelMeasure Delete a measure frpm the set of measures.
 int DelUnit(java.lang.String Measure, java.lang.String Unit)
          Documentation for: DelUnit Delete a unit from a measure.
 int GetBaseUnit(java.lang.String Measure, Conversion.ByReferenceString Unit)
          Documentation for: GetBaseUnit Get the base unit factor for a unit from a measure.
 int GetBaseUnitAbbr(java.lang.String Measure, Conversion.ByReferenceString Abbr)
          Documentation for: GetBaseUnitAbbr Get the base unit abbreviation for a unit from a measure.
 double GetConversion(int MeasureIdx, double InitValue, java.lang.String UnitFrom, java.lang.String UnitTo)
          Documentation for: GetConversion Convert a number from one unit in a measure to another unit.
 void GetMeasure(int index, Conversion.ByReferenceString Measure)
          Documentation for: GetMeasure Get the name of a measure from a particular index.
 int GetMeasureIdx(java.lang.String Measure)
          Documentation for: GetMeasureIdx Get the index of measure given its name.
 int GetMeasureList(java.lang.String Separator, Conversion.ByReferenceString MeasureList)
          Documentation for: GetMeasureList Get a single string that contains all the measure names separated by a delimiter.
 void GetUnit(int MeasureIdx, int UnitIdx, Conversion.ByReferenceString Unit)
          Documentation for: GetUnit Get the unit associated with a measure and unit index.
 void GetUnitAbbr(int MeasureIdx, int UnitIdx, Conversion.ByReferenceString Unit)
          Documentation for: GetUnitAbbr Get the base unit abbreviation for a unit from a measure.
 int GetUnitAbbrIdx(int MeasureIdx, java.lang.String Abbr)
          Documentation for: GetUnitAbbrIdx Get the unit index associated with a measure index and unit Abbr.
 int GetUnitFactor(java.lang.String Measure, java.lang.String Unit, Conversion.ByReferenceDouble Factor)
          Documentation for: GetUnitFactor Get the unit factor for a unit from a measure.
 int GetUnitIdx(int MeasureIdx, java.lang.String Unit)
          Documentation for: GetUnitIdx Get the unit index associated with a measure index and unit name.
 int GetUnitList(int MeasureIdx, java.lang.String Separator, Conversion.ByReferenceString UnitList)
          Documentation for: GetUnitList Get a single string that contains all the units in a measure separated by a delimiter.
 int GetUnitOffset(java.lang.String Measure, java.lang.String Unit, Conversion.ByReferenceDouble Offset)
          Documentation for: GetUnitOffset Get the unit factor for a unit from a measure.
 int NewUnit(java.lang.String Measure, java.lang.String Unit, java.lang.String UnitAbbr)
          Documentation for: NewUnit Create a new Unit within a measure.
 int NumMeasures()
          Documentation for: NumMeasures Returns the number of measures currently in the system.
 int NumUnits(int index)
          Documentation for: NumUnits Get the number of units for a given measure index.
 int SetUnitFactor(java.lang.String Measure, java.lang.String Unit, double Factor)
          Documentation for: SetUnitFactor Set the unit factor for a unit from a measure.
 int SetUnitOffset(java.lang.String Measure, java.lang.String Unit, double Offset)
          Documentation for: SetUnitOffset Set the unit factor for a unit from a measure.
 double sGetConversion(java.lang.String Measure, double InitValue, java.lang.String UnitFrom, java.lang.String UnitTo)
          Documentation for: sGetConversion Convert a number from one unit in a measure to another unit.
 void sGetUnit(java.lang.String Measure, int UnitIdx, Conversion.ByReferenceString Unit)
          Documentation for: sGetUnit Get the unit associated with a measure and unit index.
 void sGetUnitAbbr(java.lang.String Measure, int UnitIdx, Conversion.ByReferenceString Unit)
          Documentation for: sGetUnitAbbr Get the base unit abbreviation for a unit from a measure.
 int sGetUnitAbbrIdx(java.lang.String Measure, java.lang.String Abbr)
          Documentation for: sGetUnitAbbrIdx Get the unit index associated with a measure index and unit abbr.
 int sGetUnitIdx(java.lang.String Measure, java.lang.String Unit)
          Documentation for: sGetUnitIdx Get the unit index associated with a measure index and unit name.
 int sGetUnitList(java.lang.String Measure, java.lang.String Separator, Conversion.ByReferenceString UnitList)
          Documentation for: sGetUnitList Get a single string that contains all the units in a measure separated by a delimiter.
 int sNumUnits(java.lang.String index)
          Documentation for: sNumUnits Get the number of units for a given measure name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Conversion

public Conversion()
Method Detail

NumMeasures

public int NumMeasures()
Documentation for: NumMeasures Returns the number of measures currently in the system.


GetMeasure

public void GetMeasure(int index,
                       Conversion.ByReferenceString Measure)
Documentation for: GetMeasure Get the name of a measure from a particular index.

Parameters:
index - Index of the measure to return
Measure - The measure name at the given index

GetMeasureIdx

public int GetMeasureIdx(java.lang.String Measure)
Documentation for: GetMeasureIdx Get the index of measure given its name. If the measure is not found a negative value is returned.

Parameters:
Measure - The measure name to find the index.

GetMeasureList

public int GetMeasureList(java.lang.String Separator,
                          Conversion.ByReferenceString MeasureList)
Documentation for: GetMeasureList Get a single string that contains all the measure names separated by a delimiter. If there are no measures a negative value is returned.

Parameters:
Separator - The delimiter to be used between names of modules. Such as (",",";" etc)
MeasureList - The string to store the measure names in.

NumUnits

public int NumUnits(int index)
Documentation for: NumUnits Get the number of units for a given measure index. If the measure index is not valid a negative value is returned.

Parameters:
index - Index of the measure

sNumUnits

public int sNumUnits(java.lang.String index)
Documentation for: sNumUnits Get the number of units for a given measure name. If the measure name is not valid a negative value is returned.

Parameters:
index - Name of the measure

GetUnit

public void GetUnit(int MeasureIdx,
                    int UnitIdx,
                    Conversion.ByReferenceString Unit)
Documentation for: GetUnit Get the unit associated with a measure and unit index.

Parameters:
MeasureIdx - Index of the measure
UnitIdx - Index of the unit
Unit - Name of the unit

GetUnitAbbr

public void GetUnitAbbr(int MeasureIdx,
                        int UnitIdx,
                        Conversion.ByReferenceString Unit)
Documentation for: GetUnitAbbr Get the base unit abbreviation for a unit from a measure. A negative value will be returned if the unit or measure cannot be found. This typically occurs because the unit or measure is not in the list.

Parameters:
MeasureIdx - Index of the measure
UnitIdx - Index of the Unit
Unit - Unit abbreviation for the given unit index in the measure

sGetUnit

public void sGetUnit(java.lang.String Measure,
                     int UnitIdx,
                     Conversion.ByReferenceString Unit)
Documentation for: sGetUnit Get the unit associated with a measure and unit index.

Parameters:
Measure - Name of the measure
UnitIdx - Index of the unit
Unit - Name of the unit

sGetUnitAbbr

public void sGetUnitAbbr(java.lang.String Measure,
                         int UnitIdx,
                         Conversion.ByReferenceString Unit)
Documentation for: sGetUnitAbbr Get the base unit abbreviation for a unit from a measure. A negative value will be returned if the unit or measure cannot be found. This typically occurs because the unit or measure is not in the list.

Parameters:
Measure - Name of the measure
UnitIdx - Index of the Unit
Unit - Unit abbreviation for the given unit index in the measure

GetUnitIdx

public int GetUnitIdx(int MeasureIdx,
                      java.lang.String Unit)
Documentation for: GetUnitIdx Get the unit index associated with a measure index and unit name. A negative value is returned if the MeasureIdx is ivalid or the Unit is not found in the measure.

Parameters:
MeasureIdx - Index of the measure
Unit - Name of the unit

sGetUnitIdx

public int sGetUnitIdx(java.lang.String Measure,
                       java.lang.String Unit)
Documentation for: sGetUnitIdx Get the unit index associated with a measure index and unit name. A negative value is returned if the Measure is ivalid or the Unit is not found in the measure.

Parameters:
Measure - Name of the measure
Unit - Name of the unit

GetUnitAbbrIdx

public int GetUnitAbbrIdx(int MeasureIdx,
                          java.lang.String Abbr)
Documentation for: GetUnitAbbrIdx Get the unit index associated with a measure index and unit Abbr. A negative value is returned if the MeasureIdx is ivalid or the Abbr is not found in the measure.

Parameters:
MeasureIdx - Index of the measure
Abbr - Abbr of the unit

sGetUnitAbbrIdx

public int sGetUnitAbbrIdx(java.lang.String Measure,
                           java.lang.String Abbr)
Documentation for: sGetUnitAbbrIdx Get the unit index associated with a measure index and unit abbr. A negative value is returned if the Measure is ivalid or the Abbr is not found in the measure.

Parameters:
Measure - Name of the measure
Abbr - Abbr of the unit

GetUnitList

public int GetUnitList(int MeasureIdx,
                       java.lang.String Separator,
                       Conversion.ByReferenceString UnitList)
Documentation for: GetUnitList Get a single string that contains all the units in a measure separated by a delimiter. A negative value is returned if the MeasureIdx is ivalid or the Unit is not found in the measure.

Parameters:
MeasureIdx - Index of the measure
Separator - The delimiter to be used between names of modules. Such as (",",";" etc)
UnitList - A single string with all the units separated by the delimiter

sGetUnitList

public int sGetUnitList(java.lang.String Measure,
                        java.lang.String Separator,
                        Conversion.ByReferenceString UnitList)
Documentation for: sGetUnitList Get a single string that contains all the units in a measure separated by a delimiter. A negative value is returned if the MeasureIdx is ivalid or the Unit is not found in the measure.

Parameters:
Measure - Name of the measure
Separator - The delimiter to be used between names of modules. Such as (",",";" etc)
UnitList - A single string with all the units separated by the delimiter

GetConversion

public double GetConversion(int MeasureIdx,
                            double InitValue,
                            java.lang.String UnitFrom,
                            java.lang.String UnitTo)
Documentation for: GetConversion Convert a number from one unit in a measure to another unit.

Parameters:
MeasureIdx - Index of the measure
InitValue - Value to be converted
UnitFrom - Unit to convert from
UnitTo - Unit to convert to

sGetConversion

public double sGetConversion(java.lang.String Measure,
                             double InitValue,
                             java.lang.String UnitFrom,
                             java.lang.String UnitTo)
Documentation for: sGetConversion Convert a number from one unit in a measure to another unit.

Parameters:
Measure - Name of the measure
InitValue - Value to be converted
UnitFrom - Unit to convert from
UnitTo - Unit to convert to

AddMeasure

public int AddMeasure(java.lang.String Measure,
                      java.lang.String BaseUnit,
                      java.lang.String BaseUnitAbbr)
Documentation for: AddMeasure Add a new measure to the set of measures. A negative value will be returned if the measure cannot be added. This typically occurs because the measure is already in the list. This will add the measure for all FRAMES components.

Parameters:
Measure - Name of the new measure
BaseUnit - Base unit of the measure (i.e. meters)
BaseUnitAbbr - Base unit abbreviation (i.e. m)

DelMeasure

public int DelMeasure(java.lang.String Measure)
Documentation for: DelMeasure Delete a measure frpm the set of measures. A negative value will be returned if the measure cannot be deleted. This typically occurs because the measure is not in the list. This will delete the measure for all FRAMES components.

Parameters:
Measure - Name of the new measure

NewUnit

public int NewUnit(java.lang.String Measure,
                   java.lang.String Unit,
                   java.lang.String UnitAbbr)
Documentation for: NewUnit Create a new Unit within a measure. A negative value will be returned if the unit cannot be created. This typically occurs because the unit already exists in the list. This will create the measure for all FRAMES components.

Parameters:
Measure - Name of the measure
Unit - Unit of the new unit (i.e. kilometers)
UnitAbbr - Name of the new unit abbreviation (i.e. km)

AddUnit

public int AddUnit(java.lang.String Measure,
                   java.lang.String Unit,
                   java.lang.String UnitAbbr,
                   double Factor,
                   double Offset)
Documentation for: AddUnit Add a new Unit within a measure. A negative value will be returned if the unit cannot be added. This typically occurs because the unit already exists in the list. This will create the measure for all FRAMES components. The slope and the offset (intercept) for the line conversion can be given. This makes this API support conversion for measures like temperature where a multiplier (Factor) and an offset (intercept) are needed to define the conversion.

Parameters:
Measure - Name of the measure
Unit - Unit of the new unit (i.e. kilometers)
UnitAbbr - Name of the new unit abbreviation (i.e. km)
Factor - The slope of the line interpolation between the base unit and this new unit. (i.e. 1e-3)
Offset - The offset (intercept) of the interpolation line between the base unit and the new unit (i.e. 0.0)

DelUnit

public int DelUnit(java.lang.String Measure,
                   java.lang.String Unit)
Documentation for: DelUnit Delete a unit from a measure. A negative value will be returned if the unit cannot be deleted. This typically occurs because the unit is not in the list. This will delete the unit for all FRAMES components.

Parameters:
Measure - Name of the measure
Unit - Name of the Unit to delete

GetUnitFactor

public int GetUnitFactor(java.lang.String Measure,
                         java.lang.String Unit,
                         Conversion.ByReferenceDouble Factor)
Documentation for: GetUnitFactor Get the unit factor for a unit from a measure. A negative value will be returned if the unit cannot be found. This typically occurs because the unit is not in the list.

Parameters:
Measure - Name of the measure
Unit - Name of the Unit
Factor - Factor for conversion between this unit and the base unit of the measure

GetUnitOffset

public int GetUnitOffset(java.lang.String Measure,
                         java.lang.String Unit,
                         Conversion.ByReferenceDouble Offset)
Documentation for: GetUnitOffset Get the unit factor for a unit from a measure. A negative value will be returned if the unit cannot be found. This typically occurs because the unit is not in the list.

Parameters:
Measure - Name of the measure
Unit - Name of the Unit
Offset - Offset of conversion between this unit and the base unit of the measure

SetUnitFactor

public int SetUnitFactor(java.lang.String Measure,
                         java.lang.String Unit,
                         double Factor)
Documentation for: SetUnitFactor Set the unit factor for a unit from a measure. A negative value will be returned if the unit cannot be found. This typically occurs because the unit is not in the list. This will change the offset for all FRAMES components.

Parameters:
Measure - Name of the measure
Unit - Name of the Unit
Factor - The new Factor for conversion between this unit and the base unit of the measure

SetUnitOffset

public int SetUnitOffset(java.lang.String Measure,
                         java.lang.String Unit,
                         double Offset)
Documentation for: SetUnitOffset Set the unit factor for a unit from a measure. A negative value will be returned if the unit cannot be found. This typically occurs because the unit is not in the list. This will change the offset for all FRAMES components.

Parameters:
Measure - Name of the measure
Unit - Name of the Unit
Offset - The new Offset of conversion between this unit and the base unit of the measure

GetBaseUnit

public int GetBaseUnit(java.lang.String Measure,
                       Conversion.ByReferenceString Unit)
Documentation for: GetBaseUnit Get the base unit factor for a unit from a measure. A negative value will be returned if the unit or measure cannot be found. This typically occurs because the unit or measure is not in the list.

Parameters:
Measure - Name of the measure
Unit - Name of the base Unit

GetBaseUnitAbbr

public int GetBaseUnitAbbr(java.lang.String Measure,
                           Conversion.ByReferenceString Abbr)
Documentation for: GetBaseUnitAbbr Get the base unit abbreviation for a unit from a measure. A negative value will be returned if the unit or measure cannot be found. This typically occurs because the unit or measure is not in the list.

Parameters:
Measure - Name of the measure
Abbr - Abbreviation of the base Unit