Package org.aoju.bus.core.lang.mutable
Class MutableDouble
java.lang.Object
java.lang.Number
org.aoju.bus.core.lang.mutable.MutableDouble
- All Implemented Interfaces:
Serializable,Comparable<MutableDouble>,Mutable<Number>
可变
double 类型- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Constructor Summary
ConstructorsConstructorDescription构造,默认值0MutableDouble(double value) 构造MutableDouble(Number value) 构造MutableDouble(String value) 构造 -
Method Summary
Modifier and TypeMethodDescriptionadd(double operand) 增加值增加值intcompareTo(MutableDouble other) 比较值减一doubleboolean相等需同时满足如下条件: 非空 类型为MutableDouble值相等floatget()获得原始值inthashCode()值+1intintValue()longvoidset(double value) 设置值void设置值subtract(double operand) 减去值减去值toString()Methods inherited from class java.lang.Number
byteValue, shortValue
-
Constructor Details
-
MutableDouble
public MutableDouble()构造,默认值0 -
MutableDouble
public MutableDouble(double value) 构造- Parameters:
value- 值
-
MutableDouble
-
MutableDouble
构造- Parameters:
value- String值- Throws:
NumberFormatException- 数字转换错误
-
-
Method Details
-
get
-
set
public void set(double value) 设置值- Parameters:
value- 值
-
set
-
increment
-
decrement
-
add
-
add
-
subtract
-
subtract
-
intValue
-
longValue
-
floatValue
public float floatValue()- Specified by:
floatValuein classNumber
-
doubleValue
public double doubleValue()- Specified by:
doubleValuein classNumber
-
equals
相等需同时满足如下条件:- 非空
- 类型为
MutableDouble - 值相等
-
hashCode
-
compareTo
比较- Specified by:
compareToin interfaceComparable<MutableDouble>- Parameters:
other- 其它MutableDouble对象- Returns:
- x==y返回0,x<y返回-1,x>y返回1
-
toString
-