| Interface | osid.locale.UnitConversionSession | ||
|---|---|---|---|
| Implements | osid.OsidSession | ||
| Description | 
                 This session defines methods to convert units across measurement systems.  | ||
| Method | canConvertUnits | ||
| Description | 
                     Tests if this user can perform unit conversions. A 
                    return of true does not guarantee successful 
                    authorization. A return of false indicates that it is 
                    known all methods in this session will result in a   | ||
| Return | boolean |  false  if conversion methods are not authorized,  true 
 otherwise  | |
| Compliance | mandatory | This method must be implemented. | |
| Method | convertUnit | ||
| Description | 
                     Convert a unit of measurement.  | ||
| Parameters | decimal | sourceUnit | the measure to convert | 
osid.type.Type | sourceUnitType | the type of measure specified | |
osid.type.Type | targetUnitType | the type of converted measure | |
| Return | decimal | resulting measure | |
| Errors | NULL_ARGUMENT |  null  argument provided  |                 |
| OPERATION_FAILED | unable to complete request | ||
| PERMISSION_DENIED | authorization failure | ||
| UNSUPPORTED |  LocaleManager.supportsUnitTypesForConversion(measureType, 
conversionType)  is false  |                 ||
| Compliance | mandatory | This method must be implemented. | |
| Method | convertUnits | ||
| Description | 
                     Convert units of measurement.  | ||
| Parameters | decimal[] | sourceUnits | the measures to convert | 
osid.type.Type | sourceUnitType | the type of measure specified | |
osid.type.Type | targetUnitType | the type of converted measure | |
| Return | decimal[] | resulting measures | |
| Errors | NULL_ARGUMENT |  null  argument provided  |                 |
| OPERATION_FAILED | unable to complete request | ||
| PERMISSION_DENIED | authorization failure | ||
| UNSUPPORTED |  LocaleManager.supportsUnitTypesForConversion(measureType, 
conversionType)  is false  |                 ||
| Compliance | mandatory | This method must be implemented. | |