org.apache.hadoop.hdfs.util

## Class ConstEnumCounters<E extends Enum<E>>

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

-     public class ConstEnumCounters<E extends Enum<E>>
      extends EnumCounters<E>

  Const Counters for an enum type. It's the const version of EnumCounters. Any modification ends with a ConstEnumException.
  See Also:
    `EnumCounters`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ConstEnumCounters.ConstEnumException` An exception class for modification on ConstEnumCounters.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConstEnumCounters(Class<E> enumClass, long defaultVal)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(E e, long value)` Add the given value to counter e.
    `void` | `add(EnumCounters<E> that)` Add that counters to this counters.
    `void` | `negation()` Negate all counters.
    `void` | `reset()` Reset all counters to zero.
    `void` | `reset(long val)`
    `void` | `set(E e, long value)` Set counter e to the given value.
    `void` | `set(EnumCounters<E> that)` Set this counters to that counters.
    `void` | `subtract(E e, long value)` Subtract the given value from counter e.
    `void` | `subtract(EnumCounters<E> that)` Subtract this counters from that counters.

    - ### Methods inherited from class org.apache.hadoop.hdfs.util.EnumCounters

      `allLessOrEqual, anyGreaterOrEqual, asArray, deepCopyEnumCounter, equals, get, hashCode, sum, toString`

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

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

- - ### Constructor Detail

    - #### ConstEnumCounters

          public ConstEnumCounters(Class<E> enumClass,
                                   long defaultVal)

  - ### Method Detail

    - #### negation

          public final void negation()

      Description copied from class: `EnumCounters`
      Negate all counters.
      Overrides:
        `negation` in class `EnumCounters<E extends Enum<E>>`

    - #### set

          public final void set(E e,
                                long value)

      Description copied from class: `EnumCounters`
      Set counter e to the given value.
      Overrides:
        `set` in class `EnumCounters<E extends Enum<E>>`

    - #### set

          public final void set(EnumCounters<E> that)

      Description copied from class: `EnumCounters`
      Set this counters to that counters.
      Overrides:
        `set` in class `EnumCounters<E extends Enum<E>>`

    - #### reset

          public final void reset()

      Description copied from class: `EnumCounters`
      Reset all counters to zero.
      Overrides:
        `reset` in class `EnumCounters<E extends Enum<E>>`

    - #### add

          public final void add(E e,
                                long value)

      Description copied from class: `EnumCounters`
      Add the given value to counter e.
      Overrides:
        `add` in class `EnumCounters<E extends Enum<E>>`

    - #### add

          public final void add(EnumCounters<E> that)

      Description copied from class: `EnumCounters`
      Add that counters to this counters.
      Overrides:
        `add` in class `EnumCounters<E extends Enum<E>>`

    - #### subtract

          public final void subtract(E e,
                                     long value)

      Description copied from class: `EnumCounters`
      Subtract the given value from counter e.
      Overrides:
        `subtract` in class `EnumCounters<E extends Enum<E>>`

    - #### subtract

          public final void subtract(EnumCounters<E> that)

      Description copied from class: `EnumCounters`
      Subtract this counters from that counters.
      Overrides:
        `subtract` in class `EnumCounters<E extends Enum<E>>`

    - #### reset

          public final void reset(long val)

      Overrides:
        `reset` in class `EnumCounters<E extends Enum<E>>`

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