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 of
Remote.BiFunction
for 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:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <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.BinaryOperator
which 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.BinaryOperator
which returns the greater of two elements according to the specifiedComparable
value.static <T> Remote.BinaryOperator
<T> maxBy
(Comparator<? super T> comparator) Returns aRemote.BinaryOperator
which returns the greater of two elements according to the specifiedComparator
.static <T> Remote.BinaryOperator
<T> minBy
(Remote.Comparator<? super T> comparator) Returns aRemote.BinaryOperator
which 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.BinaryOperator
which returns the lesser of two elements according to the specifiedComparable
value.static <T> Remote.BinaryOperator
<T> minBy
(Comparator<? super T> comparator) Returns aRemote.BinaryOperator
which 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 Details
-
minBy
static <T,E extends Comparable<? super E>> Remote.BinaryOperator<T> minBy(ValueExtractor<? super T, ? extends E> comparable) Returns aRemote.BinaryOperator
which returns the lesser of two elements according to the specifiedComparable
value.- Type Parameters:
T
- the type of the input arguments of the comparator- Parameters:
comparable
- aComparator
for comparing the two values- Returns:
- a
BinaryOperator
which returns the greater of its operands, according to the suppliedComparator
- Throws:
NullPointerException
- if the argument is null
-
minBy
Returns aRemote.BinaryOperator
which returns the lesser of two elements according to the specifiedComparator
.- Type Parameters:
T
- the type of the input arguments of the comparator- Parameters:
comparator
- aComparator
for comparing the two values- Returns:
- a
BinaryOperator
which returns the lesser of its operands, according to the suppliedComparator
- Throws:
NullPointerException
- if the argument is null
-
minBy
Returns aRemote.BinaryOperator
which returns the lesser of two elements according to the specifiedComparator
.- Type Parameters:
T
- the type of the input arguments of the comparator- Parameters:
comparator
- aComparator
for comparing the two values- Returns:
- a
BinaryOperator
which 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.BinaryOperator
which returns the greater of two elements according to the specifiedComparable
value.- Type Parameters:
T
- the type of the input arguments of the comparator- Parameters:
comparable
- aComparator
for comparing the two values- Returns:
- a
BinaryOperator
which returns the greater of its operands, according to the suppliedComparator
- Throws:
NullPointerException
- if the argument is null
-
maxBy
Returns aRemote.BinaryOperator
which returns the greater of two elements according to the specifiedComparator
.- Type Parameters:
T
- the type of the input arguments of the comparator- Parameters:
comparator
- aComparator
for comparing the two values- Returns:
- a
BinaryOperator
which returns the greater of its operands, according to the suppliedComparator
- Throws:
NullPointerException
- if the argument is null
-
maxBy
Returns aRemote.BinaryOperator
which returns the greater of two elements according to the specifiedComparator
.- Type Parameters:
T
- the type of the input arguments of the comparator- Parameters:
comparator
- aComparator
for comparing the two values- Returns:
- a
BinaryOperator
which returns the greater of its operands, according to the suppliedComparator
- Throws:
NullPointerException
- if the argument is null
-
mapMerger
static <K,V, Remote.BinaryOperator<M> mapMergerM extends Map<K, V>> (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, Remote.BinaryOperator<M> mapMergerM extends Map<K, V>> (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
-