OSID Logo
OSID Specifications
locale package
Version 3.1.0
Interfaceosid.locale.UnitConversionSession
Implementsosid.OsidSession
Used Byosid.locale.LocaleManager
osid.locale.LocaleProxyManager
Description

This session defines methods to convert units across measurement systems.

MethodcanConvertUnits
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 PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations.

Returnboolean false if conversion methods are not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodconvertUnit
Description

Convert a unit of measurement.

ParametersdecimalsourceUnit the measure to convert
osid.type.TypesourceUnitType the type of measure specified
osid.type.TypetargetUnitType the type of converted measure
Returndecimal resulting measure
ErrorsNULL_ARGUMENT null argument provided
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED LocaleManager.supportsUnitTypesForConversion(measureType, conversionType) is false
Compliancemandatory This method must be implemented.
MethodconvertUnits
Description

Convert units of measurement.

Parametersdecimal[]sourceUnits the measures to convert
osid.type.TypesourceUnitType the type of measure specified
osid.type.TypetargetUnitType the type of converted measure
Returndecimal[] resulting measures
ErrorsNULL_ARGUMENT null argument provided
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED LocaleManager.supportsUnitTypesForConversion(measureType, conversionType) is false
Compliancemandatory This method must be implemented.