com.hazelcast.jet.accumulator

## Class LongAccumulator

- java.lang.Object
- - com.hazelcast.jet.accumulator.LongAccumulator

-     public class LongAccumulator
      extends Object

  Mutable container of a `long` value.
  Since:
    3.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LongAccumulator()` Creates a new instance with `value == 0`.
    `LongAccumulator(long value)` Creates a new instance with the specified value.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `LongAccumulator` | `add(long value)` Adds the supplied value to this accumulator, throwing an exception in the case of integer overflow.
    `LongAccumulator` | `add(LongAccumulator that)` Adds the value of the supplied accumulator to this accumulator, throwing an exception in the case of integer overflow.
    `LongAccumulator` | `addAllowingOverflow(long value)` Adds the supplied value to this accumulator, allowing integer overflow.
    `LongAccumulator` | `addAllowingOverflow(LongAccumulator that)` Adds the value of the supplied accumulator to this accumulator, allowing integer overflow.
    `boolean` | `equals(Object o)`
    `long` | `get()` Returns the current value.
    `int` | `hashCode()`
    `LongAccumulator` | `set(long value)` Sets the value as given.
    `LongAccumulator` | `subtract(long value)` Subtracts the supplied value from this accumulator, throwing an exception in the case of integer overflow.
    `LongAccumulator` | `subtract(LongAccumulator that)` Subtracts the value of the supplied accumulator from this one, throwing an exception in the case of integer overflow.
    `LongAccumulator` | `subtractAllowingOverflow(long value)` Subtracts the supplied value from this accumulator, allowing integer overflow.
    `LongAccumulator` | `subtractAllowingOverflow(LongAccumulator that)` Subtracts the value of the supplied accumulator from this one, allowing integer overflow.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### LongAccumulator

          public LongAccumulator()

      Creates a new instance with `value == 0`.

    - #### LongAccumulator

          public LongAccumulator(long value)

      Creates a new instance with the specified value.

  - ### Method Detail

    - #### get

          public long get()

      Returns the current value.

    - #### set

          public LongAccumulator set(long value)

      Sets the value as given.

    - #### add

          public LongAccumulator add(long value)

      Adds the supplied value to this accumulator, throwing an exception in the case of integer overflow.

    - #### add

          public LongAccumulator add(LongAccumulator that)

      Adds the value of the supplied accumulator to this accumulator, throwing an exception in the case of integer overflow.

    - #### subtract

          public LongAccumulator subtract(long value)

      Subtracts the supplied value from this accumulator, throwing an exception in the case of integer overflow.

    - #### subtract

          public LongAccumulator subtract(LongAccumulator that)

      Subtracts the value of the supplied accumulator from this one, throwing an exception in the case of integer overflow.

    - #### addAllowingOverflow

          public LongAccumulator addAllowingOverflow(long value)

      Adds the supplied value to this accumulator, allowing integer overflow. This removes the (tiny) overhead of overflow checking.

    - #### addAllowingOverflow

          public LongAccumulator addAllowingOverflow(LongAccumulator that)

      Adds the value of the supplied accumulator to this accumulator, allowing integer overflow. This removes the (tiny) overhead of overflow checking.

    - #### subtractAllowingOverflow

          public LongAccumulator subtractAllowingOverflow(long value)

      Subtracts the supplied value from this accumulator, allowing integer overflow. This removes the (tiny) overhead of overflow checking.

    - #### subtractAllowingOverflow

          public LongAccumulator subtractAllowingOverflow(LongAccumulator that)

      Subtracts the value of the supplied accumulator from this one, allowing integer overflow. This removes the (tiny) overhead of overflow checking.

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2019. All rights reserved.