类 Decimal

    • 构造器详细资料

      • 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 NumberDecimal add​(T t)
        add
        类型参数:
        T - subtype of Number
        参数:
        t - number value
        返回:
        Decimal instance
      • subtract

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

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

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

        public <T extends NumberDecimal 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 NumberDecimal 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()
      • intValue

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

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

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

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

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