Interface NumericConverter
-
- All Known Implementing Classes:
NumericConverterImpl
public interface NumericConverter
This is a interface for numeric conversion to BigDecimal or BigInteger.- Author:
- Shing Wai Chan
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_POLICY
The default policy for NumericConverter.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BigDecimal
toBigDecimal(Double d)
To convert Double to BigDecimal.BigDecimal
toBigDecimal(Float f)
To convert Float to BigDecimal.BigDecimal
toBigDecimal(Number n)
To convert Number other than BigInteger, Double and Float to BigDecimal.BigDecimal
toBigDecimal(BigInteger bInteger)
To convert BigInteger to BigDecimal.BigInteger
toBigInteger(Double d)
To convert Double to BigInteger.BigInteger
toBigInteger(Float f)
To convert Float to BigInteger.BigInteger
toBigInteger(Number n)
To convert Number other than BigDecimal, Double and Float to BigInteger.BigInteger
toBigInteger(BigDecimal bDecimal)
To convert BigDecimal to BigInteger.
-
-
-
Field Detail
-
DEFAULT_POLICY
static final int DEFAULT_POLICY
The default policy for NumericConverter.- See Also:
- Constant Field Values
-
-
Method Detail
-
toBigDecimal
BigDecimal toBigDecimal(BigInteger bInteger)
To convert BigInteger to BigDecimal.- Parameters:
bInteger
- the BigInteger to be converted- Returns:
- converted BigDecimal
-
toBigDecimal
BigDecimal toBigDecimal(Double d)
To convert Double to BigDecimal.- Parameters:
d
- the Double to be converted- Returns:
- converted BigDecimal
-
toBigDecimal
BigDecimal toBigDecimal(Float f)
To convert Float to BigDecimal.- Parameters:
f
- the Float to be converted- Returns:
- converted BigDecimal
-
toBigDecimal
BigDecimal toBigDecimal(Number n)
To convert Number other than BigInteger, Double and Float to BigDecimal.- Parameters:
n
- the Number to be converted- Returns:
- converted BigDecimal
-
toBigInteger
BigInteger toBigInteger(BigDecimal bDecimal)
To convert BigDecimal to BigInteger.- Parameters:
bDecimal
- the BigDecimal to be converted- Returns:
- converted BigInteger
-
toBigInteger
BigInteger toBigInteger(Double d)
To convert Double to BigInteger.- Parameters:
d
- the Double to be converted- Returns:
- converted BigInteger
-
toBigInteger
BigInteger toBigInteger(Float f)
To convert Float to BigInteger.- Parameters:
f
- the Float to be converted- Returns:
- converted BigInteger
-
toBigInteger
BigInteger toBigInteger(Number n)
To convert Number other than BigDecimal, Double and Float to BigInteger.- Parameters:
n
- the Number to be converted- Returns:
- converted BigInteger
-
-