public class BsonDouble extends BsonNumber implements java.lang.Comparable<BsonDouble>
Constructor and Description |
---|
BsonDouble(double value)
Construct a new instance with the given value.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(BsonDouble o) |
Decimal128 |
decimal128Value()
Returns the value of the specified number as a
Decimal128 , which may involve rounding. |
double |
doubleValue()
Returns the value of the specified number as a
double , which may involve rounding. |
boolean |
equals(java.lang.Object o) |
BsonType |
getBsonType()
Gets the BSON type of this value.
|
double |
getValue()
Gets the double value.
|
int |
hashCode() |
int |
intValue()
Returns the value of the specified number as an
int , which may involve rounding or truncation. |
long |
longValue()
Returns the value of the specified number as an
long , which may involve rounding or truncation. |
java.lang.String |
toString() |
asArray, asBinary, asBoolean, asDateTime, asDBPointer, asDecimal128, asDocument, asDouble, asInt32, asInt64, asJavaScript, asJavaScriptWithScope, asNumber, asObjectId, asRegularExpression, asString, asSymbol, asTimestamp, isArray, isBinary, isBoolean, isDateTime, isDBPointer, isDecimal128, isDocument, isDouble, isInt32, isInt64, isJavaScript, isJavaScriptWithScope, isNull, isNumber, isObjectId, isRegularExpression, isString, isSymbol, isTimestamp
public BsonDouble(double value)
value
- the valuepublic int compareTo(BsonDouble o)
compareTo
in interface java.lang.Comparable<BsonDouble>
public BsonType getBsonType()
BsonValue
getBsonType
in class BsonValue
public double getValue()
public int intValue()
BsonNumber
int
, which may involve rounding or truncation.intValue
in class BsonNumber
int
.public long longValue()
BsonNumber
long
, which may involve rounding or truncation.longValue
in class BsonNumber
long
.public Decimal128 decimal128Value()
BsonNumber
Decimal128
, which may involve rounding.decimal128Value
in class BsonNumber
Decimal128
.public double doubleValue()
BsonNumber
double
, which may involve rounding.doubleValue
in class BsonNumber
double
.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object