org.apache.tinkerpop.gremlin.util

## Class NumberHelper

- java.lang.Object
- - org.apache.tinkerpop.gremlin.util.NumberHelper

-     public final class NumberHelper
      extends Object

  Author:
    Daniel Kuppitz (http://gremlin.guru)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `BiFunction<Number,Number,Number>` | `add`
    `BiFunction<Number,Number,Integer>` | `cmp`
    `BiFunction<Number,Number,Number>` | `div`
    `BiFunction<Number,Number,Number>` | `max`
    `BiFunction<Number,Number,Number>` | `min`
    `BiFunction<Number,Number,Number>` | `mul`
    `BiFunction<Number,Number,Number>` | `sub`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Number` | `add(Number a, Number b)`
    `static Integer` | `compare(Number a, Number b)`
    `static Number` | `div(Number a, Number b)`
    `static Number` | `div(Number a, Number b, boolean forceFloatingPoint)`
    `static Class<? extends Number>` | `getHighestCommonNumberClass(boolean forceFloatingPoint, Number... numbers)`
    `static Class<? extends Number>` | `getHighestCommonNumberClass(Number... numbers)`
    `static Comparable` | `max(Comparable a, Comparable b)`
    `static Number` | `max(Number a, Number b)`
    `static Comparable` | `min(Comparable a, Comparable b)`
    `static Number` | `min(Number a, Number b)`
    `static Number` | `mul(Number a, Number b)`
    `static Number` | `sub(Number a, Number b)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### add

          public final BiFunction<Number,Number,Number> add

    - #### sub

          public final BiFunction<Number,Number,Number> sub

    - #### mul

          public final BiFunction<Number,Number,Number> mul

    - #### div

          public final BiFunction<Number,Number,Number> div

    - #### min

          public final BiFunction<Number,Number,Number> min

    - #### max

          public final BiFunction<Number,Number,Number> max

    - #### cmp

          public final BiFunction<Number,Number,Integer> cmp

  - ### Method Detail

    - #### getHighestCommonNumberClass

          public static Class<? extends Number> getHighestCommonNumberClass(Number... numbers)

    - #### getHighestCommonNumberClass

          public static Class<? extends Number> getHighestCommonNumberClass(boolean forceFloatingPoint,
                                                                            Number... numbers)

    - #### add

          public static Number add(Number a,
                                   Number b)

    - #### sub

          public static Number sub(Number a,
                                   Number b)

    - #### mul

          public static Number mul(Number a,
                                   Number b)

    - #### div

          public static Number div(Number a,
                                   Number b)

    - #### div

          public static Number div(Number a,
                                   Number b,
                                   boolean forceFloatingPoint)

    - #### min

          public static Number min(Number a,
                                   Number b)

    - #### min

          public static Comparable min(Comparable a,
                                       Comparable b)

    - #### max

          public static Number max(Number a,
                                   Number b)

    - #### max

          public static Comparable max(Comparable a,
                                       Comparable b)

    - #### compare

          public static Integer compare(Number a,
                                        Number b)

Copyright © 2013–2020 Apache Software Foundation. All rights reserved.