T - the type of the values being comparedpublic static class Max.MaxFn<T> extends Combine.BinaryCombineFn<T>
CombineFn that computes the maximum of a collection of elements of type T
using an arbitrary Comparator, 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>).| Modifier and Type | Method and Description |
|---|---|
T |
apply(T left,
T right)
Applies the binary operation to the two operands, returning the result.
|
T |
identity()
Returns the value that should be used for the combine of the empty set.
|
static <T extends Comparable<? super T>> |
naturalOrder() |
static <T extends Comparable<? super T>> |
naturalOrder(T identity) |
static <T,ComparatorT extends Comparator<? super T> & Serializable> |
of(ComparatorT comparator) |
static <T,ComparatorT extends Comparator<? super T> & Serializable> |
of(T identity,
ComparatorT comparator) |
addInput, createAccumulator, extractOutput, getAccumulatorCoder, getDefaultOutputCoder, mergeAccumulatorsapply, asKeyedFn, getOutputTypepublic static <T,ComparatorT extends Comparator<? super T> & Serializable> Max.MaxFn<T> of(T identity, ComparatorT comparator)
public static <T,ComparatorT extends Comparator<? super T> & Serializable> Max.MaxFn<T> of(ComparatorT comparator)
public static <T extends Comparable<? super T>> Max.MaxFn<T> naturalOrder(T identity)
public static <T extends Comparable<? super T>> Max.MaxFn<T> naturalOrder()
public T identity()
Combine.BinaryCombineFnidentity in class Combine.BinaryCombineFn<T>public T apply(T left, T right)
Combine.BinaryCombineFnapply in class Combine.BinaryCombineFn<T>