org.apache.hadoop.hdfs.util

## Class EnumDoubles<E extends Enum<E>>

- java.lang.Object
- - org.apache.hadoop.hdfs.util.EnumDoubles<E>

- Type Parameters:
    `E` - the enum type

      public class EnumDoubles<E extends Enum<E>>
      extends Object

  Similar to `EnumCounters` except that the value type is double.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EnumDoubles(Class<E> enumClass)` Construct doubles for the given enum constants.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(E e, double value)` Add the given value to e.
    `void` | `add(EnumDoubles<E> that)` Add the values of that object to this.
    `boolean` | `equals(Object obj)`
    `double` | `get(E e)`
    `int` | `hashCode()`
    `void` | `negation()` Negate all values.
    `void` | `reset()` Reset all values to zero.
    `void` | `set(E e, double value)` Set e to the given value.
    `void` | `set(EnumDoubles<E> that)` Set the values of this object to that object.
    `void` | `subtract(E e, double value)` Subtract the given value from e.
    `void` | `subtract(EnumDoubles<E> that)` Subtract the values of this object from that object.
    `String` | `toString()`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### EnumDoubles

          public EnumDoubles(Class<E> enumClass)

      Construct doubles for the given enum constants.
      Parameters:
        `enumClass` - the enum class.

  - ### Method Detail

    - #### get

          public final double get(E e)

      Returns:
        the value corresponding to e.

    - #### negation

          public final void negation()

      Negate all values.

    - #### set

          public final void set(E e,
                                double value)

      Set e to the given value.

    - #### set

          public final void set(EnumDoubles<E> that)

      Set the values of this object to that object.

    - #### reset

          public final void reset()

      Reset all values to zero.

    - #### add

          public final void add(E e,
                                double value)

      Add the given value to e.

    - #### add

          public final void add(EnumDoubles<E> that)

      Add the values of that object to this.

    - #### subtract

          public final void subtract(E e,
                                     double value)

      Subtract the given value from e.

    - #### subtract

          public final void subtract(EnumDoubles<E> that)

      Subtract the values of this object from that object.

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.