Package com.almis.awe.service
Class NumericService
java.lang.Object
com.almis.awe.config.ServiceConfig
com.almis.awe.service.NumericService
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
Numeric service Class
Numeric Utilities for AWE
- Author:
- Pablo GARCIA - 16/APR/2012
-
Constructor Summary
ConstructorDescriptionNumericService
(NumericConfigProperties numericConfigProperties) Hide the constructor -
Method Summary
Modifier and TypeMethodDescriptionapplyPattern
(String pattern, Double value) Fixes an string value for a criteriaapplyPatternWithLocale
(String pattern, Double value, String format) Fixes a string value for a criteria in a raw pattern with localeapplyPatternWithLocale
(String pattern, Double value, NumberFormat numberFormat) Fixes a string value for a criteria in a raw pattern with localeapplyRawPattern
(String pattern, Double value) Fixes a string value for a criteria in a raw pattern Use Locale USformatNumber
(NumberFormat format, Double value) Fixes a string value for a criteria in a raw pattern with localeint
Returns decimals number a string that represents a formatted numericint
Returns decimals number a string that represents a raw formatted numericparseNumericString
(String val) Parses a string value to a number.Parses a string value to a number.Methods inherited from class com.almis.awe.config.ServiceConfig
containsBean, getApplicationContext, getBean, getBean, getElements, getLocale, getLocale, getProperty, getProperty, getRequest, getSession, setApplicationContext
-
Constructor Details
-
NumericService
Hide the constructor- Parameters:
numericConfigProperties
- Numeric configuration properties
-
-
Method Details
-
applyPattern
Fixes an string value for a criteria- Parameters:
pattern
- pattern to applyvalue
- string number value- Returns:
- number formatted
-
applyRawPattern
Fixes a string value for a criteria in a raw pattern Use Locale US- Parameters:
pattern
- Number patternvalue
- String value- Returns:
- Value fixed
-
applyPatternWithLocale
Fixes a string value for a criteria in a raw pattern with locale- Parameters:
pattern
- patter to applyvalue
- number valueformat
- LOCALE to apply- Returns:
- String with pattern applied
-
applyPatternWithLocale
Fixes a string value for a criteria in a raw pattern with locale- Parameters:
pattern
- patter to applyvalue
- number valuenumberFormat
- LOCALE to apply- Returns:
- String with pattern applied
-
formatNumber
Fixes a string value for a criteria in a raw pattern with locale- Parameters:
format
- Number formatvalue
- number value- Returns:
- Number formatted
-
parseNumericString
Parses a string value to a number. It reads the numeric type from numeric.properties- Parameters:
val
- String value with format as defined in numeric.properties- Returns:
- parsedValue parsed number
- Throws:
ParseException
- Error parsing number
-
parseRawNumericString
Parses a string value to a number. It parses a string that represents a raw formatted numeric- Parameters:
val
- String value with format as defined in numeric.properties- Returns:
- parsedValue parsed number
- Throws:
ParseException
- Error parsing number
-
getDecimalsNumberInNumericString
Returns decimals number a string that represents a formatted numeric- Parameters:
val
- String value with format as defined in numeric.properties- Returns:
- decimals number
-
getDecimalsNumberInRawNumericString
Returns decimals number a string that represents a raw formatted numeric- Parameters:
val
- String value with format as defined in numeric.properties- Returns:
- decimals number
-