ConstEnumCounters (Apache Hadoop HDFS 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.util, class: ConstEnumCounters

Package 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
  Description
  `static final class`
  `ConstEnumCounters.ConstEnumException`
  An exception class for modification on ConstEnumCounters.

- ## Constructor Summary

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

- ## Method Summary

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

  - ### ConstEnumCounters

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

- ## Method Details

  - ### 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>>`