NumT - the type of the Numbers being comparedpublic static class Min.MinFn<NumT extends Comparable<NumT>> extends Combine.BinaryCombineFn<NumT>
CombineFn that computes the minimum of a collection
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 |
|---|
MinFn(NumT initialValue)
Constructs a combining function that computes the minimum over
a collection of values of type
N, given the largest
value of type N, which is the identity value for the
minimum 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 MinFn(NumT initialValue)
N, given the largest
value of type N, which is the identity value for the
minimum 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>>