com.google.cloud.dataflow.sdk.transforms

## Class Sum.SumDoubleFn

- java.lang.Object
- - com.google.cloud.dataflow.sdk.transforms.Combine.CombineFn<Double,double[],Double>
  - - com.google.cloud.dataflow.sdk.transforms.Combine.BinaryCombineDoubleFn
    - - com.google.cloud.dataflow.sdk.transforms.Sum.SumDoubleFn

All Implemented Interfaces:
  CombineFnBase.GlobalCombineFn<Double,double[],Double>, HasDisplayData, com.google.cloud.dataflow.sdk.util.common.CounterProvider<Double>, Serializable

Enclosing class:
  Sum

    public static class Sum.SumDoubleFn
    extends Combine.BinaryCombineDoubleFn
    implements com.google.cloud.dataflow.sdk.util.common.CounterProvider<Double>

A `SerializableFunction` that computes the sum of an `Iterable` of `Double`s, useful as an argument to `Combine.globally(com.google.cloud.dataflow.sdk.transforms.SerializableFunction<java.lang.Iterable<V>, V>)` or `Combine.perKey(com.google.cloud.dataflow.sdk.transforms.SerializableFunction<java.lang.Iterable<V>, V>)`.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`SumDoubleFn()`

### Method Summary

All Methods Instance Methods Concrete Methods
`double` `apply(double a, double b)` Applies the binary operation to the two operands, returning the result.
`TypeVariable<?>` `getAccumTVariable()` Returns the `TypeVariable` of `AccumT`.
`com.google.cloud.dataflow.sdk.util.common.Counter<Double>` `getCounter(String name)`
`String` `getIncompatibleGlobalWindowErrorMessage()` Returns the error message for not supported default values in Combine.globally().
`TypeVariable<?>` `getInputTVariable()` Returns the `TypeVariable` of `InputT`.
`TypeVariable<?>` `getOutputTVariable()` Returns the `TypeVariable` of `OutputT`.
`double` `identity()` Returns the identity element of this operation, i.e.
`void` `populateDisplayData(DisplayData.Builder builder)` Register display data for the given transform or component.

### Methods inherited from class com.google.cloud.dataflow.sdk.transforms.Combine.BinaryCombineDoubleFn

`addInput, createAccumulator, extractOutput, getAccumulatorCoder, getDefaultOutputCoder, mergeAccumulators`

### Methods inherited from class com.google.cloud.dataflow.sdk.transforms.Combine.CombineFn

`apply, asKeyedFn, compact, defaultValue, getOutputType`

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

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

### Constructor Detail

#### SumDoubleFn

    public SumDoubleFn()

### Method Detail

#### apply

    public double apply(double a,
                        double b)

Description copied from class: `Combine.BinaryCombineDoubleFn`
Applies the binary operation to the two operands, returning the result.

Specified by:
  `apply` in class `Combine.BinaryCombineDoubleFn`

#### identity

    public double identity()

Description copied from class: `Combine.BinaryCombineDoubleFn`
Returns the identity element of this operation, i.e. an element `e` such that `apply(e, x) == apply(x, e) == x` for all values of `x`.

Specified by:
  `identity` in class `Combine.BinaryCombineDoubleFn`

#### getCounter

    public com.google.cloud.dataflow.sdk.util.common.Counter<Double> getCounter(String name)

Specified by:
  `getCounter` in interface `com.google.cloud.dataflow.sdk.util.common.CounterProvider<Double>`
Overrides:
  `getCounter` in class `Combine.BinaryCombineDoubleFn`

#### getIncompatibleGlobalWindowErrorMessage

    public String getIncompatibleGlobalWindowErrorMessage()

Description copied from interface: `CombineFnBase.GlobalCombineFn`
Returns the error message for not supported default values in Combine.globally().

Specified by:
  `getIncompatibleGlobalWindowErrorMessage` in interface `CombineFnBase.GlobalCombineFn<InputT,AccumT,OutputT>`

#### getInputTVariable

    public TypeVariable<?> getInputTVariable()

Returns the `TypeVariable` of `InputT`.

#### getAccumTVariable

    public TypeVariable<?> getAccumTVariable()

Returns the `TypeVariable` of `AccumT`.

#### getOutputTVariable

    public TypeVariable<?> getOutputTVariable()

Returns the `TypeVariable` of `OutputT`.

#### populateDisplayData

    public void populateDisplayData(DisplayData.Builder builder)

Register display data for the given transform or component.

`populateDisplayData(DisplayData.Builder)` is invoked by Pipeline runners to collect display data via `DisplayData.from(HasDisplayData)`. Implementations may call `super.populateDisplayData(builder)` in order to register display data in the current namespace, but should otherwise use `subcomponent.populateDisplayData(builder)` to use the namespace of the subcomponent.

By default, does not register any display data. Implementors may override this method to provide their own display data.

Specified by:
  `populateDisplayData` in interface `HasDisplayData`
Parameters:
  `builder` - The builder to populate with display data.
See Also:
  `HasDisplayData`