Comparable<JsLong>
, JsElem
, JsNumber
public final class JsLong extends Object implements JsNumber, Comparable<JsLong>
Modifier and Type | Field | Description |
---|---|---|
long |
x |
The long primitive.
|
Modifier and Type | Method | Description |
---|---|---|
int |
compareTo(JsLong o) |
Compares two
JsLong objects numerically. |
boolean |
equals(@Nullable Object that) |
Indicates whether some other object is "equal to" this json long.
|
int |
hashCode() |
Returns the hashcode of this json long.
|
JsLong |
map(LongUnaryOperator fn) |
Maps this json long into another one.
|
JsLong |
minus(JsLong that) |
subtract this long from the specified one
|
static JsLong |
of(long n) |
Static factory method to create a JsLong from a long primitive type.
|
JsLong |
plus(JsLong that) |
adds up this long to the specified one
|
boolean |
test(LongPredicate predicate) |
Tests the value of this json long on a predicate.
|
JsLong |
times(JsLong 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(JsLong o)
JsLong
objects numerically.compareTo
in interface Comparable<JsLong>
Long.compareTo(Long)
public boolean equals(@Nullable Object that)
JsLong.parse(1).equals(JsLong.parse(1))
JsLong.parse(1).equals(JsInt.parse(1))
JsLong.parse(1).equals(JsBigInt.parse(BigInteger.ONE))
JsLong.parse(1).equals(JsBigDec.parse(BigDecimal.valueOf(1.0)))
JsLong.parse(1).equals(JsDouble.parse(1.0))
public int hashCode()
public JsLong map(LongUnaryOperator fn)
fn
- the mapping functionpublic JsLong plus(JsLong that)
that
- the specified longpublic JsLong minus(JsLong that)
that
- the specified longpublic JsLong times(JsLong that)
that
- the specified longpublic boolean test(LongPredicate predicate)
predicate
- the predicatepublic String toString()
toString
in class Object
Long.toString
public static JsLong of(long n)
n
- the long primitive typeCopyright © 2019. All rights reserved.