类 Decimal

java.lang.Object
java.lang.Number
com.xwl41.common.basic.helper.Decimal
所有已实现的接口:
Serializable, Comparable<Decimal>

public class Decimal extends Number implements Comparable<Decimal>
Java BigDecimal simple decorator for simplifying BigDecimal operations
另请参阅:
  • 构造器详细资料

    • Decimal

      public Decimal()
      no argument
    • Decimal

      public Decimal(String value)
      String argument
      参数:
      value - number value in String format
    • Decimal

      public Decimal(BigDecimal value)
      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 value
      scale - scale for BigDecimal
    • Decimal

      public Decimal(T t, int scale, RoundingMode roundingMode)
      Number Type argument with scale and rounding mode setting
      类型参数:
      T - subtype of Number
      参数:
      t - number value
      scale - scale for BigDecimal
      roundingMode - rounding mode for BigDecimal
  • 方法详细资料

    • add

      public <T extends Number> Decimal add(T t)
      add
      类型参数:
      T - subtype of Number
      参数:
      t - number value
      返回:
      Decimal instance
    • subtract

      public <T extends Number> Decimal subtract(T subtrahend)
      subtract
      类型参数:
      T - subtype of Number
      参数:
      subtrahend - number value
      返回:
      Decimal instance
    • multiply

      public <T extends Number> Decimal multiply(T t)
      multiply
      类型参数:
      T - subtype of Number
      参数:
      t - number value
      返回:
      Decimal instance
    • divide

      public <T extends Number> Decimal divide(T t)
      divide
      类型参数:
      T - subtype of Number
      参数:
      t - number value
      返回:
      Decimal instance
    • divide

      public <T extends Number> Decimal divide(T t, int scale)
      divide with scale setting
      类型参数:
      T - subtype of Number
      参数:
      t - number value
      scale - scale of BigDecimal
      返回:
      Decimal instance
    • divide

      public <T extends Number> Decimal divide(T t, int scale, RoundingMode roundingMode)
      divide with scale and rounding mode setting
      类型参数:
      T - subtype of Number
      参数:
      t - number value
      scale - scale of BigDecimal
      roundingMode - rounding mode of BigDecimal
      返回:
      Decimal instance
    • get

      public BigDecimal get()
      get BigDecimal value from Decimal instance
      返回:
      BigDecimal instance
    • setScale

      public Decimal setScale(int newScale)
      set scale
      参数:
      newScale - new scale of BigDecimal
      返回:
      Decimal instance
    • setScale

      public Decimal setScale(int newScale, RoundingMode roundingMode)
      set scale and rounding mode
      参数:
      newScale - new scale of BigDecimal
      roundingMode - rounding mode of BigDecimal
      返回:
      Decimal instance
    • newDecimal

      public static Decimal newDecimal()
    • compareTo

      public int compareTo(Decimal o)
      指定者:
      compareTo 在接口中 Comparable<Decimal>
    • intValue

      public int intValue()
      指定者:
      intValue 在类中 Number
    • longValue

      public long longValue()
      指定者:
      longValue 在类中 Number
    • floatValue

      public float floatValue()
      指定者:
      floatValue 在类中 Number
    • doubleValue

      public double doubleValue()
      指定者:
      doubleValue 在类中 Number
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • equals

      public boolean equals(Object o)
      覆盖:
      equals 在类中 Object
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object