Package com.tangosol.util.function
Interface Remote.BinaryOperator<T>
-
- Type Parameters:
T- the type of the operands and result of the operator
- All Superinterfaces:
BiFunction<T,T,T>,BinaryOperator<T>,Remote.BiFunction<T,T,T>,Serializable
- Enclosing class:
- Remote
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public static interface Remote.BinaryOperator<T> extends Remote.BiFunction<T,T,T>, BinaryOperator<T>, Serializable
Represents an operation upon two operands of the same type, producing a result of the same type as the operands. This is a specialization ofRemote.BiFunctionfor the case where the operands and the result are all of the same type.This is a functional interface whose functional method is
BiFunction.apply(Object, Object).- See Also:
Remote.BiFunction,Remote.UnaryOperator
-
-
Method Summary
Static Methods Modifier and Type Method Description static <K,V,M extends Map<K,V>>
Remote.BinaryOperator<M>mapMerger(Remote.BinaryOperator<V> mergeFunction)BinaryOperator<Map>that merges the contents of its right argument into its left argument, using the provided merge function to handle duplicate keys.static <K,V,M extends Map<K,V>>
Remote.BinaryOperator<M>mapMerger(BinaryOperator<V> mergeFunction)BinaryOperator<Map>that merges the contents of its right argument into its left argument, using the provided merge function to handle duplicate keys.static <T> Remote.BinaryOperator<T>maxBy(Remote.Comparator<? super T> comparator)Returns aRemote.BinaryOperatorwhich returns the greater of two elements according to the specifiedComparator.static <T,E extends Comparable<? super E>>
Remote.BinaryOperator<T>maxBy(ValueExtractor<? super T,? extends E> comparable)Returns aRemote.BinaryOperatorwhich returns the greater of two elements according to the specifiedComparablevalue.static <T> Remote.BinaryOperator<T>maxBy(Comparator<? super T> comparator)Returns aRemote.BinaryOperatorwhich returns the greater of two elements according to the specifiedComparator.static <T> Remote.BinaryOperator<T>minBy(Remote.Comparator<? super T> comparator)Returns aRemote.BinaryOperatorwhich returns the lesser of two elements according to the specifiedComparator.static <T,E extends Comparable<? super E>>
Remote.BinaryOperator<T>minBy(ValueExtractor<? super T,? extends E> comparable)Returns aRemote.BinaryOperatorwhich returns the lesser of two elements according to the specifiedComparablevalue.static <T> Remote.BinaryOperator<T>minBy(Comparator<? super T> comparator)Returns aRemote.BinaryOperatorwhich returns the lesser of two elements according to the specifiedComparator.-
Methods inherited from interface java.util.function.BiFunction
andThen, apply
-
Methods inherited from interface com.tangosol.util.function.Remote.BiFunction
andThen
-
-
-
-
Method Detail
-
minBy
static <T,E extends Comparable<? super E>> Remote.BinaryOperator<T> minBy(ValueExtractor<? super T,? extends E> comparable)
Returns aRemote.BinaryOperatorwhich returns the lesser of two elements according to the specifiedComparablevalue.- Type Parameters:
T- the type of the input arguments of the comparator- Parameters:
comparable- aComparatorfor comparing the two values- Returns:
- a
BinaryOperatorwhich returns the greater of its operands, according to the suppliedComparator - Throws:
NullPointerException- if the argument is null
-
minBy
static <T> Remote.BinaryOperator<T> minBy(Remote.Comparator<? super T> comparator)
Returns aRemote.BinaryOperatorwhich returns the lesser of two elements according to the specifiedComparator.- Type Parameters:
T- the type of the input arguments of the comparator- Parameters:
comparator- aComparatorfor comparing the two values- Returns:
- a
BinaryOperatorwhich returns the lesser of its operands, according to the suppliedComparator - Throws:
NullPointerException- if the argument is null
-
minBy
static <T> Remote.BinaryOperator<T> minBy(Comparator<? super T> comparator)
Returns aRemote.BinaryOperatorwhich returns the lesser of two elements according to the specifiedComparator.- Type Parameters:
T- the type of the input arguments of the comparator- Parameters:
comparator- aComparatorfor comparing the two values- Returns:
- a
BinaryOperatorwhich returns the lesser of its operands, according to the suppliedComparator - Throws:
NullPointerException- if the argument is null
-
maxBy
static <T,E extends Comparable<? super E>> Remote.BinaryOperator<T> maxBy(ValueExtractor<? super T,? extends E> comparable)
Returns aRemote.BinaryOperatorwhich returns the greater of two elements according to the specifiedComparablevalue.- Type Parameters:
T- the type of the input arguments of the comparator- Parameters:
comparable- aComparatorfor comparing the two values- Returns:
- a
BinaryOperatorwhich returns the greater of its operands, according to the suppliedComparator - Throws:
NullPointerException- if the argument is null
-
maxBy
static <T> Remote.BinaryOperator<T> maxBy(Remote.Comparator<? super T> comparator)
Returns aRemote.BinaryOperatorwhich returns the greater of two elements according to the specifiedComparator.- Type Parameters:
T- the type of the input arguments of the comparator- Parameters:
comparator- aComparatorfor comparing the two values- Returns:
- a
BinaryOperatorwhich returns the greater of its operands, according to the suppliedComparator - Throws:
NullPointerException- if the argument is null
-
maxBy
static <T> Remote.BinaryOperator<T> maxBy(Comparator<? super T> comparator)
Returns aRemote.BinaryOperatorwhich returns the greater of two elements according to the specifiedComparator.- Type Parameters:
T- the type of the input arguments of the comparator- Parameters:
comparator- aComparatorfor comparing the two values- Returns:
- a
BinaryOperatorwhich returns the greater of its operands, according to the suppliedComparator - Throws:
NullPointerException- if the argument is null
-
mapMerger
static <K,V,M extends Map<K,V>> Remote.BinaryOperator<M> mapMerger(Remote.BinaryOperator<V> mergeFunction)
BinaryOperator<Map>that merges the contents of its right argument into its left argument, using the provided merge function to handle duplicate keys.- Type Parameters:
K- type of the map keysV- type of the map valuesM- type of the map- Parameters:
mergeFunction- A merge function suitable forMap.merge()- Returns:
- a merge function for two maps
-
mapMerger
static <K,V,M extends Map<K,V>> Remote.BinaryOperator<M> mapMerger(BinaryOperator<V> mergeFunction)
BinaryOperator<Map>that merges the contents of its right argument into its left argument, using the provided merge function to handle duplicate keys.- Type Parameters:
K- type of the map keysV- type of the map valuesM- type of the map- Parameters:
mergeFunction- A merge function suitable forMap.merge()- Returns:
- a merge function for two maps
-
-