메소드 | 설명 | |
---|---|---|
AddBaseUnit ( Primitive dimension, Primitive name ) : void |
Add a base unit to the system.
|
|
AddConstant ( Primitive description, Primitive name, Primitive value ) : void |
Add a dimensionless constant to the system.
|
|
AddDerivedUnit ( Primitive description, Primitive name, Primitive units, Primitive add ) : void |
Add a derived unit to the system.
|
|
Convert ( Primitive value, Primitive fromUnit, Primitive toUnit ) : Primitive |
Convert a value from one unit to another.
|
|
Export ( ) : void |
Export the current unit system to a file (units.txt in the current program folder).
|
|
GetBaseUnits ( ) : Primitive |
Get a list of current base units.
|
|
GetConstants ( ) : Primitive |
Get a list of current constants.
|
|
GetDerivedUnits ( ) : Primitive |
Get a list of current derived units.
|
|
GetDimensions ( Primitive unit ) : Primitive |
Get an array of dimensions for a unit.
|
|
GetErrors ( ) : Primitive |
Get an array of error messages if a Convert fails or conflicts are found for added units or constants.
|
|
GetPrefixes ( ) : Primitive |
Get a list of current prefixes.
|
|
Import ( ) : void |
Import a unit system from a file (units.txt in the current program folder).
|
public static AddBaseUnit ( Primitive dimension, Primitive name ) : void | ||
dimension | Primitive | The base unit dimension (e.g. TEMPERATURE). |
name | Primitive | The unit name (be careful it doesn't confict with existing unit names). |
리턴 | void |
public static AddConstant ( Primitive description, Primitive name, Primitive value ) : void | ||
description | Primitive | An optional long name or description of the constant. |
name | Primitive | The constant name (be careful it doesn't confict with existing constant names). |
value | Primitive | The derived constant value. |
리턴 | void |
public static AddDerivedUnit ( Primitive description, Primitive name, Primitive units, Primitive add ) : void | ||
description | Primitive | An optional long name or description of the derived unit. |
name | Primitive | The unit name (be careful it doesn't confict with existing unit names). |
units | Primitive | The derived unit definition. |
add | Primitive | An optional addition term. |
리턴 | void |
public static Convert ( Primitive value, Primitive fromUnit, Primitive toUnit ) : Primitive | ||
value | Primitive | The value to convert. |
fromUnit | Primitive | The units to convert from. |
toUnit | Primitive | The units to convert to. |
리턴 | Primitive |
public static GetDimensions ( Primitive unit ) : Primitive | ||
unit | Primitive | The unit to get dimensins of. |
리턴 | Primitive |