Comparable<JsDouble>
, JsElem
, JsNumber
public final class JsDouble extends Object implements JsNumber, Comparable<JsDouble>
Modifier and Type | Field | Description |
---|---|---|
double |
x |
The double value.
|
Modifier and Type | Method | Description |
---|---|---|
int |
compareTo(JsDouble o) |
Compares two
JsDouble objects numerically. |
boolean |
equals(@Nullable Object that) |
Indicates whether some other object is "equal to" this json double.
|
int |
hashCode() |
Returns the hashcode of this json double.
|
JsDouble |
map(DoubleUnaryOperator fn) |
Maps this json double into another one.
|
JsDouble |
minus(JsDouble that) |
subtract this long from the specified one
|
static JsDouble |
of(double n) |
Static factory method to create a JsDouble from a double primitive type.
|
JsDouble |
plus(JsDouble that) |
adds up this long to the specified one
|
boolean |
test(DoublePredicate predicate) |
Tests the value of this json double on a predicate.
|
JsDouble |
times(JsDouble that) |
multiplies this long by the specified one
|
String |
toString() |
asJsArray, asJsBigDec, asJsBigInt, asJsBool, asJsDouble, asJsInt, asJsLong, asJsObj, asJson, asJsStr, isArray, isArray, isBigDec, isBigDec, isBigInt, isBigInt, isBool, isDouble, isDouble, isFalse, isInstant, isInstant, isInt, isInt, isIntegral, isJson, isJson, isLocalDate, isLocalDate, isLocalDateTime, isLocalDateTime, isLong, isLong, isNothing, isNotJson, isNotNothing, isNotNull, isNotNumber, isNull, isNumber, isObj, isObj, isStr, isStr, isTrue
public int compareTo(JsDouble o)
JsDouble
objects numerically.compareTo
in interface Comparable<JsDouble>
Double.compareTo(Double)
public boolean equals(@Nullable Object that)
JsDouble.of(1.0).equals(JsDouble.of(1))
JsDouble.of(1).equals(JsInt.of(1))
JsDouble.of(1).equals(JsBigInt.of(BigInteger.ONE))
JsDouble.of(1).equals(JsBigDec.of(BigDecimal.valueOf(1.0)))
JsDouble.of(1).equals(JsLong.of(1))
public int hashCode()
public JsDouble map(DoubleUnaryOperator fn)
fn
- the mapping functionpublic JsDouble plus(JsDouble that)
that
- the specified longpublic JsDouble minus(JsDouble that)
that
- the specified longpublic JsDouble times(JsDouble that)
that
- the specified longpublic boolean test(DoublePredicate predicate)
predicate
- the predicatepublic static JsDouble of(double n)
n
- the double primitive typepublic String toString()
toString
in class Object
Double.toString
Copyright © 2019. All rights reserved.