Package oracle.sql.json
Interface OracleJsonNumber
-
- All Superinterfaces:
OracleJsonValue
- All Known Subinterfaces:
OracleJsonDecimal,OracleJsonDouble,OracleJsonFloat
public interface OracleJsonNumber extends OracleJsonValue
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface oracle.sql.json.OracleJsonValue
OracleJsonValue.OracleJsonType
-
-
Field Summary
-
Fields inherited from interface oracle.sql.json.OracleJsonValue
FALSE, NULL, TRUE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BigDecimalbigDecimalValue()Returns this number as aBigDecimalvalue.BigIntegerbigIntegerValue()Returns this number as aBigInteger.BigIntegerbigIntegerValueExact()Returns this number as aBigInteger.doubledoubleValue()Returns this value as adouble.floatfloatValue()Returns this value as afloat.intintValue()Returns this number as an int.intintValueExact()Returns this number as an int.booleanisIntegral()Returns true whenbigDecimalValue().scale() == 0.longlongValue()Returns this number as a long.longlongValueExact()Returns this number as an long.-
Methods inherited from interface oracle.sql.json.OracleJsonValue
asJsonArray, asJsonBinary, asJsonDate, asJsonDecimal, asJsonDouble, asJsonFloat, asJsonIntervalDS, asJsonIntervalYM, asJsonNumber, asJsonObject, asJsonString, asJsonTimestamp, asJsonTimestampTZ, getOracleJsonType, toString, wrap
-
-
-
-
Method Detail
-
isIntegral
boolean isIntegral()
Returns true whenbigDecimalValue().scale() == 0.- Returns:
- true if this is an integral number
-
intValue
int intValue()
Returns this number as an int. This number may lose information about the overall magnitude and precision of the number value.- Returns:
- the number as an int
-
intValueExact
int intValueExact()
Returns this number as an int.- Returns:
- the number as an int
- Throws:
ArithmeticException- if the number has a non-fractional part or if it does not fit in an int
-
longValue
long longValue()
Returns this number as a long. This number may lose information about the overall magnitude and precision of the number value.- Returns:
- the number as an long
-
longValueExact
long longValueExact()
Returns this number as an long.- Returns:
- the number as an long
- Throws:
ArithmeticException- if the number has a non-fractional part or if it does not fit in an long
-
bigDecimalValue
BigDecimal bigDecimalValue()
Returns this number as aBigDecimalvalue.- Returns:
- the number as a
BigDecimal
-
bigIntegerValue
BigInteger bigIntegerValue()
Returns this number as aBigInteger. This number may lose information about the overall magnitude and precision of the number value.- Returns:
- the number as an
BigInteger
-
bigIntegerValueExact
BigInteger bigIntegerValueExact()
Returns this number as aBigInteger.- Returns:
- the number as an
BigInteger - Throws:
ArithmeticException- if the number has a non-fractional part or if it does not fit in an long
-
doubleValue
double doubleValue()
Returns this value as adouble. For values of typeOracleJsonValue.OracleJsonType.DECIMALthis method may lose information about the overall magnitude and precision of the number value.- Returns:
- the number as a
double.
-
floatValue
float floatValue()
Returns this value as afloat. For values of typeOracleJsonValue.OracleJsonType.DECIMALorOracleJsonValue.OracleJsonType.DOUBLEthis method may lose information about the overall magnitude and precision of the number value.- Returns:
- the number as a
float.
-
-