Top Description Inners Fields Constructors Methods
org.eclipse.collections.impl.block.factory

public final Class Functions2

extends Object
Class Inheritance
Imports
java.util.Comparator, org.eclipse.collections.api.block.function.Function, .Function2, .Function3, org.eclipse.collections.impl.block.function.checked.CheckedFunction2, .ThrowingFunction2

Contains factory methods for creating Function2 instances.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static class
Functions2.MaxByFunction2<T, V extends Comparable<? super V>>

private static class
private static class
Functions2.MinByFunction2<T, V extends Comparable<? super V>>

private static class
private static class

Field Summary

Modifier and TypeField and Description
private static final Function2<Integer, Integer, Integer>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static <T, V, P> Function2<T, P, V>
fromFunction(Function<? super T, ? extends V> function)

public static Function2<Integer, Integer, Integer>
public static <T> Function2<T, T, T>
max(Comparator<? super T> comparator)

public static <T, V extends Comparable<? super V>> Function2<T, T, T>
maxBy(Function<? super T, ? extends V> function)

public static <T> Function2<T, T, T>
min(Comparator<? super T> comparator)

public static <T, V extends Comparable<? super V>> Function2<T, T, T>
minBy(Function<? super T, ? extends V> function)

public static <T, V, P> Function2<T, P, V>
throwing(ThrowingFunction2<T, P, V> throwingFunction2)

Allows a lambda or anonymous inner class that needs to throw a checked exception to be safely wrapped as a Function2 that will throw a RuntimeException, wrapping the checked exception that is the cause.

public static <T1, T2, V> Function2<T1, T2, V>
throwing(ThrowingFunction2<T1, T2, V> throwingFunction2, Function3<T1, T2, ? super Throwable, ? extends RuntimeException> rethrow)

Allows a lambda or anonymous inner class that needs to throw a checked exception to be safely wrapped as a Function2 that will throw a user specified RuntimeException based on the provided function.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INTEGER_ADDITIONback to summary
private static final Function2<Integer, Integer, Integer> INTEGER_ADDITION

Constructor Detail

Functions2back to summary
private Functions2()

Method Detail

fromFunctionback to summary
public static <T, V, P> Function2<T, P, V> fromFunction(Function<? super T, ? extends V> function)
integerAdditionback to summary
public static Function2<Integer, Integer, Integer> integerAddition()
maxback to summary
public static <T> Function2<T, T, T> max(Comparator<? super T> comparator)
maxByback to summary
public static <T, V extends Comparable<? super V>> Function2<T, T, T> maxBy(Function<? super T, ? extends V> function)
minback to summary
public static <T> Function2<T, T, T> min(Comparator<? super T> comparator)
minByback to summary
public static <T, V extends Comparable<? super V>> Function2<T, T, T> minBy(Function<? super T, ? extends V> function)
throwingback to summary
public static <T, V, P> Function2<T, P, V> throwing(ThrowingFunction2<T, P, V> throwingFunction2)

Allows a lambda or anonymous inner class that needs to throw a checked exception to be safely wrapped as a Function2 that will throw a RuntimeException, wrapping the checked exception that is the cause.

throwingback to summary
public static <T1, T2, V> Function2<T1, T2, V> throwing(ThrowingFunction2<T1, T2, V> throwingFunction2, Function3<T1, T2, ? super Throwable, ? extends RuntimeException> rethrow)

Allows a lambda or anonymous inner class that needs to throw a checked exception to be safely wrapped as a Function2 that will throw a user specified RuntimeException based on the provided function. The function is passed the current element and the checked exception that was thrown as context arguments.

org.eclipse.collections.impl.block.factory back to summary

private final Class Functions2.FunctionAdapter<T, P, V>

extends Object
implements Function2<T, P, V>
Class Inheritance
  • java.lang.Object
  • org.eclipse.collections.impl.block.factory.Functions2.FunctionAdapter
All Implemented Interfaces
org.eclipse.collections.api.block.function.Function2, java.io.Serializable, java.util.function.BiFunction

Field Summary

Modifier and TypeField and Description
private final Function<? super T, ? extends V>
private static final long

Constructor Summary

AccessConstructor and Description
private
FunctionAdapter(Function<? super T, ? extends V> function)

Method Summary

Modifier and TypeMethod and Description
public V
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

functionback to summary
private final Function<? super T, ? extends V> function
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

FunctionAdapterback to summary
private FunctionAdapter(Function<? super T, ? extends V> function)

Method Detail

valueback to summary
public V value(T each, P parameter)

Implements org.eclipse.collections.api.block.function.Function2.value.

Annotations
@Override
org.eclipse.collections.impl.block.factory back to summary

private Class Functions2.IntegerAddition

extends Object
implements Function2<Integer, Integer, Integer>
Class Inheritance
  • java.lang.Object
  • org.eclipse.collections.impl.block.factory.Functions2.IntegerAddition
All Implemented Interfaces
org.eclipse.collections.api.block.function.Function2, java.io.Serializable, java.util.function.BiFunction

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Integer
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

IntegerAdditionback to summary
private IntegerAddition()

Method Detail

valueback to summary
public Integer value(Integer aggregate, Integer value)

Implements org.eclipse.collections.api.block.function.Function2.value.

Annotations
@Override
org.eclipse.collections.impl.block.factory back to summary

private final Class Functions2.MaxByFunction2<T, V extends Comparable<? super V>>

extends Object
implements Function2<T, T, T>
Class Inheritance
  • java.lang.Object
  • org.eclipse.collections.impl.block.factory.Functions2.MaxByFunction2
All Implemented Interfaces
org.eclipse.collections.api.block.function.Function2, java.io.Serializable, java.util.function.BiFunction

Field Summary

Modifier and TypeField and Description
private final Function<? super T, ? extends V>
private static final long

Constructor Summary

AccessConstructor and Description
private
MaxByFunction2(Function<? super T, ? extends V> function)

Method Summary

Modifier and TypeMethod and Description
public T
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

functionback to summary
private final Function<? super T, ? extends V> function
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

MaxByFunction2back to summary
private MaxByFunction2(Function<? super T, ? extends V> function)

Method Detail

valueback to summary
public T value(T argument1, T argument2)

Implements org.eclipse.collections.api.block.function.Function2.value.

Annotations
@Override
org.eclipse.collections.impl.block.factory back to summary

private final Class Functions2.MaxFunction2<T>

extends Object
implements Function2<T, T, T>
Class Inheritance
  • java.lang.Object
  • org.eclipse.collections.impl.block.factory.Functions2.MaxFunction2
All Implemented Interfaces
org.eclipse.collections.api.block.function.Function2, java.io.Serializable, java.util.function.BiFunction

Field Summary

Modifier and TypeField and Description
private final Comparator<? super T>
private static final long

Constructor Summary

AccessConstructor and Description
private
MaxFunction2(Comparator<? super T> comparator)

Method Summary

Modifier and TypeMethod and Description
public T
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

comparatorback to summary
private final Comparator<? super T> comparator
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

MaxFunction2back to summary
private MaxFunction2(Comparator<? super T> comparator)

Method Detail

valueback to summary
public T value(T argument1, T argument2)

Implements org.eclipse.collections.api.block.function.Function2.value.

Annotations
@Override
org.eclipse.collections.impl.block.factory back to summary

private final Class Functions2.MinByFunction2<T, V extends Comparable<? super V>>

extends Object
implements Function2<T, T, T>
Class Inheritance
  • java.lang.Object
  • org.eclipse.collections.impl.block.factory.Functions2.MinByFunction2
All Implemented Interfaces
org.eclipse.collections.api.block.function.Function2, java.io.Serializable, java.util.function.BiFunction

Field Summary

Modifier and TypeField and Description
private final Function<? super T, ? extends V>
private static final long

Constructor Summary

AccessConstructor and Description
private
MinByFunction2(Function<? super T, ? extends V> function)

Method Summary

Modifier and TypeMethod and Description
public T
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

functionback to summary
private final Function<? super T, ? extends V> function
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

MinByFunction2back to summary
private MinByFunction2(Function<? super T, ? extends V> function)

Method Detail

valueback to summary
public T value(T argument1, T argument2)

Implements org.eclipse.collections.api.block.function.Function2.value.

Annotations
@Override
org.eclipse.collections.impl.block.factory back to summary

private final Class Functions2.MinFunction2<T>

extends Object
implements Function2<T, T, T>
Class Inheritance
  • java.lang.Object
  • org.eclipse.collections.impl.block.factory.Functions2.MinFunction2
All Implemented Interfaces
org.eclipse.collections.api.block.function.Function2, java.io.Serializable, java.util.function.BiFunction

Field Summary

Modifier and TypeField and Description
private final Comparator<? super T>
private static final long

Constructor Summary

AccessConstructor and Description
private
MinFunction2(Comparator<? super T> comparator)

Method Summary

Modifier and TypeMethod and Description
public T
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

comparatorback to summary
private final Comparator<? super T> comparator
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

MinFunction2back to summary
private MinFunction2(Comparator<? super T> comparator)

Method Detail

valueback to summary
public T value(T argument1, T argument2)

Implements org.eclipse.collections.api.block.function.Function2.value.

Annotations
@Override
org.eclipse.collections.impl.block.factory back to summary

private final Class Functions2.ThrowingFunction2Adapter<T, P, V>

extends CheckedFunction2<T, P, V>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final long
private final ThrowingFunction2<T, P, V>

Constructor Summary

AccessConstructor and Description
private
ThrowingFunction2Adapter(ThrowingFunction2<T, P, V> throwingFunction2)

Method Summary

Modifier and TypeMethod and Description
public V
Inherited from org.eclipse.collections.impl.block.function.checked.CheckedFunction2:
value

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.eclipse.collections.impl.block.function.checked.CheckedFunction2.serialVersionUID.

throwingFunction2back to summary
private final ThrowingFunction2<T, P, V> throwingFunction2

Constructor Detail

ThrowingFunction2Adapterback to summary
private ThrowingFunction2Adapter(ThrowingFunction2<T, P, V> throwingFunction2)

Method Detail

safeValueback to summary
public V safeValue(T argument1, P argument2) throws Exception

Implements org.eclipse.collections.impl.block.function.checked.ThrowingFunction2.safeValue.

Annotations
@Override