public class MutableLong extends Number implements Comparable<MutableLong>, Mutable<Number>
long
类型Long
,
Serialized FormConstructor and Description |
---|
MutableLong()
构造,默认值0
|
MutableLong(long value)
构造
|
MutableLong(Number value)
构造
|
MutableLong(String value)
构造
|
Modifier and Type | Method and Description |
---|---|
MutableLong |
add(long operand)
增加值
|
MutableLong |
add(Number operand)
增加值
|
int |
compareTo(MutableLong other)
比较
|
MutableLong |
decrement()
值减一
|
double |
doubleValue() |
boolean |
equals(Object obj)
相等需同时满足如下条件:
非空
类型为 MutableLong
值相等
|
float |
floatValue() |
Long |
get()
获得原始值
|
int |
hashCode() |
MutableLong |
increment()
值+1
|
int |
intValue() |
long |
longValue() |
void |
set(long value)
设置值
|
void |
set(Number value)
设置值
|
MutableLong |
subtract(long operand)
减去值
|
MutableLong |
subtract(Number operand)
减去值
|
String |
toString() |
byteValue, shortValue
public MutableLong()
public MutableLong(long value)
value
- 值public MutableLong(Number value)
value
- 值public MutableLong(String value) throws NumberFormatException
value
- String值NumberFormatException
- 数字转换错误public void set(long value)
value
- 值public MutableLong increment()
public MutableLong decrement()
public MutableLong add(long operand)
operand
- 被增加的值public MutableLong add(Number operand)
operand
- 被增加的值,非空NullPointerException
- if the object is nullpublic MutableLong subtract(long operand)
operand
- 被减的值public MutableLong subtract(Number operand)
operand
- 被减的值,非空NullPointerException
- if the object is nullpublic float floatValue()
floatValue
in class Number
public double doubleValue()
doubleValue
in class Number
public boolean equals(Object obj)
public int compareTo(MutableLong other)
compareTo
in interface Comparable<MutableLong>
other
- 其它 MutableLong 对象Copyright © 2024. All rights reserved.