org.apache.ignite.internal.util.lang.gridfunc

## Class LongSumReducer

- java.lang.Object
- - org.apache.ignite.internal.util.lang.gridfunc.LongSumReducer

All Implemented Interfaces:
  Serializable, IgniteReducer<Long,Long>

    public class LongSumReducer
    extends Object
    implements IgniteReducer<Long,Long>

Reducer that calculates sum of long integer elements.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`LongSumReducer()`

### Method Summary

Methods
`boolean` `collect(Long e)` Collects given value.
`Long` `reduce()` Reduces collected values into one.
`String` `toString()`

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

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

### Constructor Detail

#### LongSumReducer

    public LongSumReducer()

### Method Detail

#### collect

    public boolean collect(Long e)

Collects given value. If this method returns `false` then `IgniteReducer.reduce()` will be called right away. Otherwise caller will continue collecting until all values are processed.

Specified by:
  `collect` in interface `IgniteReducer<Long,Long>`
Parameters:
  `e` - Value to collect.
Returns:
  `true` to continue collecting, `false` to instruct caller to stop collecting and call `IgniteReducer.reduce()` method.

#### reduce

    public Long reduce()

Reduces collected values into one.

Specified by:
  `reduce` in interface `IgniteReducer<Long,Long>`
Returns:
  Reduced value.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.0.0
Release Date | : April 30 2017