Package org.bson
Class BsonNumber
- java.lang.Object
- 
- org.bson.BsonValue
- 
- org.bson.BsonNumber
 
 
- 
- Direct Known Subclasses:
- BsonDecimal128,- BsonDouble,- BsonInt32,- BsonInt64
 
 public abstract class BsonNumber extends BsonValue Base class for the three numeric BSON types. This class mirrors the functionality provided byjava.lang.Number.- Since:
- 3.0
 
- 
- 
Constructor SummaryConstructors Constructor Description BsonNumber()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract Decimal128decimal128Value()Returns the value of the specified number as aDecimal128, which may involve rounding.abstract doubledoubleValue()Returns the value of the specified number as adouble, which may involve rounding.abstract intintValue()Returns the value of the specified number as anint, which may involve rounding or truncation.abstract longlongValue()Returns the value of the specified number as anlong, which may involve rounding or truncation.- 
Methods inherited from class org.bson.BsonValueasArray, asBinary, asBoolean, asDateTime, asDBPointer, asDecimal128, asDocument, asDouble, asInt32, asInt64, asJavaScript, asJavaScriptWithScope, asNumber, asObjectId, asRegularExpression, asString, asSymbol, asTimestamp, getBsonType, isArray, isBinary, isBoolean, isDateTime, isDBPointer, isDecimal128, isDocument, isDouble, isInt32, isInt64, isJavaScript, isJavaScriptWithScope, isNull, isNumber, isObjectId, isRegularExpression, isString, isSymbol, isTimestamp
 
- 
 
- 
- 
- 
Method Detail- 
intValuepublic abstract int intValue() Returns the value of the specified number as anint, which may involve rounding or truncation.- Returns:
- the numeric value represented by this object after conversion to type int.
 
 - 
longValuepublic abstract long longValue() Returns the value of the specified number as anlong, which may involve rounding or truncation.- Returns:
- the numeric value represented by this object after conversion to type long.
 
 - 
doubleValuepublic abstract double doubleValue() Returns the value of the specified number as adouble, which may involve rounding.- Returns:
- the numeric value represented by this object after conversion to type double.
 
 - 
decimal128Valuepublic abstract Decimal128 decimal128Value() Returns the value of the specified number as aDecimal128, which may involve rounding.- Returns:
- the numeric value represented by this object after conversion to type Decimal128.
- Since:
- 3.4
 
 
- 
 
-