类 MutableInt
java.lang.Object
java.lang.Number
com.luna.common.mutable.MutableInt
- 所有已实现的接口:
Mutable<Number>,Serializable,Comparable<MutableInt>
可变
int 类型-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明add(int operand) 增加值增加值intcompareTo(MutableInt other) 比较值减一doubleboolean相等需同时满足如下条件: 非空 类型为MutableInt值相等floatget()获得原始值inthashCode()值+1intintValue()longvoidset(int value) 设置值void设置值subtract(int operand) 减去值减去值toString()从类继承的方法 java.lang.Number
byteValue, shortValue
-
构造器详细资料
-
MutableInt
public MutableInt()构造,默认值0 -
MutableInt
public MutableInt(int value) 构造- 参数:
value- 值
-
MutableInt
构造- 参数:
value- 值
-
MutableInt
构造- 参数:
value- String值- 抛出:
NumberFormatException- 数字转换错误
-
-
方法详细资料
-
get
从接口复制的说明:Mutable获得原始值 -
set
public void set(int value) 设置值- 参数:
value- 值
-
set
从接口复制的说明:Mutable设置值 -
increment
值+1- 返回:
- this
-
decrement
值减一- 返回:
- this
-
add
增加值- 参数:
operand- 被增加的值- 返回:
- this
-
add
增加值- 参数:
operand- 被增加的值,非空- 返回:
- this
- 抛出:
NullPointerException- if the object is null
-
subtract
减去值- 参数:
operand- 被减的值- 返回:
- this
-
subtract
减去值- 参数:
operand- 被减的值,非空- 返回:
- this
- 抛出:
NullPointerException- if the object is null
-
intValue
public int intValue() -
longValue
public long longValue() -
floatValue
public float floatValue()- 指定者:
floatValue在类中Number
-
doubleValue
public double doubleValue()- 指定者:
doubleValue在类中Number
-
equals
相等需同时满足如下条件:- 非空
- 类型为
MutableInt - 值相等
-
hashCode
public int hashCode() -
compareTo
比较- 指定者:
compareTo在接口中Comparable<MutableInt>- 参数:
other- 其它MutableInt对象- 返回:
- x==y返回0,x<y返回-1,x>y返回1
-
toString
-