类 Decimal
java.lang.Object
java.lang.Number
com.xwl41.common.basic.helper.Decimal
- 所有已实现的接口:
Serializable,Comparable<Decimal>
Java BigDecimal simple decorator for simplifying BigDecimal operations
- 另请参阅:
-
构造器概要
构造器构造器说明Decimal()no argumentString argumentDecimal(BigDecimal value) BigDecimal argumentDecimal(T t) Number Type argumentDecimal(T t, int scale) Number Type argument with scale settingDecimal(T t, int scale, RoundingMode roundingMode) Number Type argument with scale and rounding mode setting -
方法概要
修饰符和类型方法说明add(T t) addintdivide(T t) dividedivide(T t, int scale) divide with scale settingdivide(T t, int scale, RoundingMode roundingMode) divide with scale and rounding mode settingdoublebooleanfloatget()get BigDecimal value from Decimal instanceinthashCode()intintValue()longmultiply(T t) multiplystatic DecimalsetScale(int newScale) set scalesetScale(int newScale, RoundingMode roundingMode) set scale and rounding modesubtract(T subtrahend) subtracttoString()从类继承的方法 java.lang.Number
byteValue, shortValue
-
构造器详细资料
-
Decimal
public Decimal()no argument -
Decimal
String argument- 参数:
value- number value in String format
-
Decimal
BigDecimal argument- 参数:
value- BigDecimal instance
-
Decimal
public Decimal(T t) Number Type argument- 类型参数:
T- subtype of Number- 参数:
t- number value
-
Decimal
public Decimal(T t, int scale) Number Type argument with scale setting- 类型参数:
T- subtype of Number- 参数:
t- number valuescale- scale for BigDecimal
-
Decimal
Number Type argument with scale and rounding mode setting- 类型参数:
T- subtype of Number- 参数:
t- number valuescale- scale for BigDecimalroundingMode- rounding mode for BigDecimal
-
-
方法详细资料
-
add
add- 类型参数:
T- subtype of Number- 参数:
t- number value- 返回:
- Decimal instance
-
subtract
subtract- 类型参数:
T- subtype of Number- 参数:
subtrahend- number value- 返回:
- Decimal instance
-
multiply
multiply- 类型参数:
T- subtype of Number- 参数:
t- number value- 返回:
- Decimal instance
-
divide
divide- 类型参数:
T- subtype of Number- 参数:
t- number value- 返回:
- Decimal instance
-
divide
divide with scale setting- 类型参数:
T- subtype of Number- 参数:
t- number valuescale- scale of BigDecimal- 返回:
- Decimal instance
-
divide
divide with scale and rounding mode setting- 类型参数:
T- subtype of Number- 参数:
t- number valuescale- scale of BigDecimalroundingMode- rounding mode of BigDecimal- 返回:
- Decimal instance
-
get
get BigDecimal value from Decimal instance- 返回:
- BigDecimal instance
-
setScale
set scale- 参数:
newScale- new scale of BigDecimal- 返回:
- Decimal instance
-
setScale
set scale and rounding mode- 参数:
newScale- new scale of BigDecimalroundingMode- rounding mode of BigDecimal- 返回:
- Decimal instance
-
newDecimal
-
compareTo
- 指定者:
compareTo在接口中Comparable<Decimal>
-
intValue
public int intValue() -
longValue
public long longValue() -
floatValue
public float floatValue()- 指定者:
floatValue在类中Number
-
doubleValue
public double doubleValue()- 指定者:
doubleValue在类中Number
-
toString
-
equals
-
hashCode
public int hashCode()
-