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

public final Class Procedures2

extends Object
Class Inheritance
Imports
java.util.Collection, .DoubleSummaryStatistics, .IntSummaryStatistics, .LongSummaryStatistics, org.eclipse.collections.api.block.function.Function, .Function0, .Function3, org.eclipse.collections.api.block.function.primitive.DoubleFunction, .FloatFunction, .IntFunction, .LongFunction, org.eclipse.collections.api.block.procedure.Procedure, .Procedure2, org.eclipse.collections.impl.block.procedure.checked.CheckedProcedure2, .ThrowingProcedure2

Contains factory methods for creating Procedure2 instances.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static class
private static class

Field Summary

Modifier and TypeField and Description
public static final Procedure2<?, ?>
public static final Procedure2<?, ?>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static <T> Procedure2<T, Collection<T>>
public static <T, P> Procedure2<T, P>
fromProcedure(Procedure<? super T> procedure)

public static <T> Procedure2<T, Collection<T>>
public static <T> Procedure2<DoubleSummaryStatistics, T>
public static <T> Procedure2<DoubleSummaryStatistics, T>
public static <T> Procedure2<IntSummaryStatistics, T>
public static <T> Procedure2<LongSummaryStatistics, T>
public static <T, P> Procedure2<T, P>
throwing(ThrowingProcedure2<T, P> throwingProcedure2)

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

public static <T1, T2> Procedure2<T1, T2>
throwing(ThrowingProcedure2<T1, T2> throwingProcedure, 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 Procedure2 that will throw a user specified RuntimeException based on the provided function.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ADD_TO_COLLECTIONback to summary
public static final Procedure2<?, ?> ADD_TO_COLLECTION
REMOVE_FROM_COLLECTIONback to summary
public static final Procedure2<?, ?> REMOVE_FROM_COLLECTION

Constructor Detail

Procedures2back to summary
private Procedures2()

Method Detail

addToCollectionback to summary
public static <T> Procedure2<T, Collection<T>> addToCollection()
fromProcedureback to summary
public static <T, P> Procedure2<T, P> fromProcedure(Procedure<? super T> procedure)
removeFromCollectionback to summary
public static <T> Procedure2<T, Collection<T>> removeFromCollection()
summarizeDoubleback to summary
public static <T> Procedure2<DoubleSummaryStatistics, T> summarizeDouble(DoubleFunction<? super T> function)

Use with org.eclipse.collections.api.RichIterable#aggregateInPlaceBy(Function, Function0, Procedure2)

Since
9.2.
summarizeFloatback to summary
public static <T> Procedure2<DoubleSummaryStatistics, T> summarizeFloat(FloatFunction<? super T> function)

Use with org.eclipse.collections.api.RichIterable#aggregateInPlaceBy(Function, Function0, Procedure2)

Since
9.2.
summarizeIntback to summary
public static <T> Procedure2<IntSummaryStatistics, T> summarizeInt(IntFunction<? super T> function)

Use with org.eclipse.collections.api.RichIterable#aggregateInPlaceBy(Function, Function0, Procedure2)

Since
9.2.
summarizeLongback to summary
public static <T> Procedure2<LongSummaryStatistics, T> summarizeLong(LongFunction<? super T> function)

Use with org.eclipse.collections.api.RichIterable#aggregateInPlaceBy(Function, Function0, Procedure2)

Since
9.2.
throwingback to summary
public static <T, P> Procedure2<T, P> throwing(ThrowingProcedure2<T, P> throwingProcedure2)

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

throwingback to summary
public static <T1, T2> Procedure2<T1, T2> throwing(ThrowingProcedure2<T1, T2> throwingProcedure, 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 Procedure2 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 Class Procedures2.AddToCollection<T>

extends Object
implements Procedure2<T, Collection<T>>
Class Inheritance
  • java.lang.Object
  • org.eclipse.collections.impl.block.factory.Procedures2.AddToCollection
All Implemented Interfaces
org.eclipse.collections.api.block.procedure.Procedure2, java.io.Serializable, java.util.function.BiConsumer

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 void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

AddToCollectionback to summary
private AddToCollection()

Method Detail

valueback to summary
public void value(T each, Collection<T> target)

Implements org.eclipse.collections.api.block.procedure.Procedure2.value.

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

private final Class Procedures2.ProcedureAdapter<T, P>

extends Object
implements Procedure2<T, P>
Class Inheritance
  • java.lang.Object
  • org.eclipse.collections.impl.block.factory.Procedures2.ProcedureAdapter
All Implemented Interfaces
org.eclipse.collections.api.block.procedure.Procedure2, java.io.Serializable, java.util.function.BiConsumer

Field Summary

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

Constructor Summary

AccessConstructor and Description
private
ProcedureAdapter(Procedure<? super T> procedure)

Method Summary

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

Field Detail

procedureback to summary
private final Procedure<? super T> procedure
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

ProcedureAdapterback to summary
private ProcedureAdapter(Procedure<? super T> procedure)

Method Detail

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

Implements org.eclipse.collections.api.block.procedure.Procedure2.value.

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

private Class Procedures2.RemoveFromCollection<T>

extends Object
implements Procedure2<T, Collection<T>>
Class Inheritance
  • java.lang.Object
  • org.eclipse.collections.impl.block.factory.Procedures2.RemoveFromCollection
All Implemented Interfaces
org.eclipse.collections.api.block.procedure.Procedure2, java.io.Serializable, java.util.function.BiConsumer

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 void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

RemoveFromCollectionback to summary
private RemoveFromCollection()

Method Detail

valueback to summary
public void value(T each, Collection<T> target)

Implements org.eclipse.collections.api.block.procedure.Procedure2.value.

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

private final Class Procedures2.ThrowingProcedure2Adapter<T, P>

extends CheckedProcedure2<T, P>
Class Inheritance

Field Summary

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

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
Inherited from org.eclipse.collections.impl.block.procedure.checked.CheckedProcedure2:
value

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.eclipse.collections.impl.block.procedure.checked.CheckedProcedure2.serialVersionUID.

throwingProcedure2back to summary
private final ThrowingProcedure2<T, P> throwingProcedure2

Constructor Detail

ThrowingProcedure2Adapterback to summary
private ThrowingProcedure2Adapter(ThrowingProcedure2<T, P> throwingProcedure2)

Method Detail

safeValueback to summary
public void safeValue(T object, P parameter) throws Exception

Implements org.eclipse.collections.impl.block.procedure.checked.ThrowingProcedure2.safeValue.

Annotations
@Override