Interface NumericFormattingSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods to format and parse numbers.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can format and parse numbers.String[]cardinalsToStrings(long[] c) Gets a string representation of an array of cardinals.cardinalToString(long c) Gets a string representation of a cardinal.String[]Gets a string representation of an array of decimals.decimalToString(String str) Parses a decimal string.Gets a string representation of a decimal.Gets the numeric format type used in this session.String[]integersToStrings(long[] i) Gets a string representation of an array of integers.integerToString(long i) Gets a string representation of an integer.longintegerToString(String str) Parses an integer string.longstringToCardinal(String str) Parses a cardinal string.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getNumericFormatType
Type getNumericFormatType()Gets the numeric format type used in this session. The numeric format type indicates the format of a number used in a culture, such as the use of a period for a decimal place.- Returns:
- the target language
- Compliance:
mandatory- This method must be implemented.
-
canFormatNumbers
boolean canFormatNumbers()Tests if this user can format and parse numbers. 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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations.- Returns:
falseif translation methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
cardinalToString
Gets a string representation of a cardinal.- Parameters:
c- a cardinal value- Returns:
- the display string
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
cardinalsToStrings
Gets a string representation of an array of cardinals.- Parameters:
c- a cardinal value array- Returns:
- the display strings
- Throws:
NullArgumentException-cisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
stringToCardinal
Parses a cardinal string.- Parameters:
str- a cardinal string- Returns:
- the cardinal value
- Throws:
InvalidArgumentException-strnot ofgetNumericFormatType()NullArgumentException-strisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
decimalToString
Gets a string representation of a decimal.- Parameters:
d- a decimal value- Returns:
- the display string
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
decimalsToStrings
String[] decimalsToStrings(BigDecimal[] d) throws OperationFailedException, PermissionDeniedException Gets a string representation of an array of decimals.- Parameters:
d- a decimals value array- Returns:
- the display strings
- Throws:
NullArgumentException-disnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
decimalToString
Parses a decimal string.- Parameters:
str- a decimal string- Returns:
- the decimal value
- Throws:
InvalidArgumentException-strnot ofgetNumericFormatType()NullArgumentException-strisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
integerToString
Gets a string representation of an integer.- Parameters:
i- an integer value- Returns:
- the display string
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
integersToStrings
Gets a string representation of an array of integers.- Parameters:
i- an integer value array- Returns:
- the display strings
- Throws:
NullArgumentException-iisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
integerToString
Parses an integer string.- Parameters:
str- an integer string- Returns:
- the integer value
- Throws:
InvalidArgumentException-strnot ofgetNumericFormatType()NullArgumentException-strisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-