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