Package org.miaixz.bus.core.lang.mutable
Class MutableShort
java.lang.Object
java.lang.Number
org.miaixz.bus.core.lang.mutable.MutableShort
- All Implemented Interfaces:
Serializable,Comparable<MutableShort>,Mutable<Number>
可变
short 类型- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Constructor Summary
ConstructorsConstructorDescription构造,默认值0MutableShort(short value) 构造MutableShort(Number value) 构造MutableShort(String value) 构造 -
Method Summary
-
Constructor Details
-
MutableShort
public MutableShort()构造,默认值0 -
MutableShort
public MutableShort(short value) 构造- Parameters:
value- 值
-
MutableShort
构造- Parameters:
value- 值
-
MutableShort
构造- Parameters:
value- String值- Throws:
NumberFormatException- 转为Short错误
-
-
Method Details
-
get
Description copied from interface:Mutable获得原始值 -
set
public void set(short value) 设置值- Parameters:
value- 值
-
set
Description copied from interface:Mutable设置值 -
increment
值+1- Returns:
- this
-
decrement
值减一- Returns:
- this
-
add
增加值- Parameters:
operand- 被增加的值- Returns:
- this
-
add
增加值- Parameters:
operand- 被增加的值,非空- Returns:
- this
- Throws:
NullPointerException- if the object is null
-
subtract
减去值- Parameters:
operand- 被减的值- Returns:
- this
-
subtract
减去值- Parameters:
operand- 被减的值,非空- Returns:
- this
- Throws:
NullPointerException- if the object is null
-
shortValue
public short shortValue()- Overrides:
shortValuein classNumber
-
intValue
public int intValue() -
longValue
public long longValue() -
floatValue
public float floatValue()- Specified by:
floatValuein classNumber
-
doubleValue
public double doubleValue()- Specified by:
doubleValuein classNumber
-
equals
相等需同时满足如下条件:- 非空
- 类型为
MutableShort - 值相等
-
hashCode
public int hashCode() -
compareTo
比较- Specified by:
compareToin interfaceComparable<MutableShort>- Parameters:
other- 其它MutableShort对象- Returns:
- x==y返回0,x<y返回-1,x>y返回1
-
toString
-