NumT - the type of the Numbers being comparedpublic static class Max.MaxFn<NumT extends Comparable<NumT>> extends Combine.BinaryCombineFn<NumT>
CombineFn that computes the maximum of a set of elements
of type N, 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>).| Constructor and Description |
|---|
MaxFn(NumT initialValue)
Constructs a combining function that computes the maximum over
a collection of values of type
N, given the smallest
value of type N, which is the identity value for the
maximum operation over Ns. |
| Modifier and Type | Method and Description |
|---|---|
NumT |
apply(NumT a,
NumT b)
Applies the binary operation to the two operands, returning the result.
|
NumT |
identity()
Returns the value that should be used for the combine of the empty set.
|
addInput, createAccumulator, extractOutput, getAccumulatorCoder, getDefaultOutputCoder, mergeAccumulatorsapply, asKeyedFn, getOutputTypepublic MaxFn(NumT initialValue)
N, given the smallest
value of type N, which is the identity value for the
maximum operation over Ns.public NumT apply(NumT a, NumT b)
Combine.BinaryCombineFnapply in class Combine.BinaryCombineFn<NumT extends Comparable<NumT>>public NumT identity()
Combine.BinaryCombineFnidentity in class Combine.BinaryCombineFn<NumT extends Comparable<NumT>>