N - the type of the Numbers being comparedpublic static class Max.MaxFn<N extends java.lang.Comparable<N>> extends Combine.BinaryCombineFn<N>
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 |
|---|
Max.MaxFn(N 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 |
|---|---|
N |
apply(N a,
N b)
Applies the binary operation to the two operands, returning the result.
|
N |
identity()
Returns the value that should be used for the combine of the empty set.
|
addInput, createAccumulator, extractOutput, getAccumulatorCoder, getDefaultOutputCoder, mergeAccumulatorsapply, asKeyedFnpublic Max.MaxFn(N initialValue)
N, given the smallest
value of type N, which is the identity value for the
maximum operation over Ns.public N apply(N a, N b)
Combine.BinaryCombineFnapply in class Combine.BinaryCombineFn<N extends java.lang.Comparable<N>>public N identity()
Combine.BinaryCombineFnidentity in class Combine.BinaryCombineFn<N extends java.lang.Comparable<N>>