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

public final Class Procedures

extends Object
Class Inheritance
Imports
java.io.IOException, .PrintStream, org.eclipse.collections.api.block.function.Function2, org.eclipse.collections.api.block.predicate.Predicate, org.eclipse.collections.api.block.procedure.Procedure, .Procedure2, org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure, org.eclipse.collections.impl.block.procedure.CaseProcedure, .IfProcedure, org.eclipse.collections.impl.block.procedure.checked.CheckedProcedure, .ThrowingProcedure

Factory class for commonly used procedures.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static enum
private static class
private static class
public static class
private static class

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static <T> Procedure<T>
append(Appendable appendable)

public static <T, P> Procedure<T>
bind(Procedure2<? super T, ? super P> procedure, P parameter)

public static <T> CaseProcedure<T>
caseDefault(Procedure<? super T> defaultProcedure)

public static <T> CaseProcedure<T>
caseDefault(Procedure<? super T> defaultProcedure, Predicate<? super T> predicate, Procedure<? super T> procedure)

public static <T> Procedure<T>
cast(Procedure<T> procedure)

Allows a Java 8 lambda and method to be used in a forEach method without requiring a cast.

public static <T> Procedure<T>
fromObjectIntProcedure(ObjectIntProcedure<? super T> objectIntProcedure)

public static <T> Procedure<T>
fromProcedureWithInt(ObjectIntProcedure<? super T> objectIntProcedure)
Deprecated since 1.2 - Inlineable

public static <T> Procedure<T>
ifElse(Predicate<? super T> predicate, Procedure<? super T> trueProcedure, Procedure<? super T> falseProcedure)

public static <T> Procedure<T>
ifTrue(Predicate<? super T> predicate, Procedure<? super T> block)

public static <T> Procedure<T>
noop()

public static <T> Procedure<T>
public static <T> Procedure<T>
public static <T> Procedure<T>
throwing(ThrowingProcedure<T> throwingProcedure)

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

public static <T> Procedure<T>
throwing(ThrowingProcedure<T> throwingProcedure, Function2<T, ? 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 Procedure that will throw a user specified RuntimeException based on the provided function.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Proceduresback to summary
private Procedures()

Method Detail

appendback to summary
public static <T> Procedure<T> append(Appendable appendable)
bindback to summary
public static <T, P> Procedure<T> bind(Procedure2<? super T, ? super P> procedure, P parameter)
caseDefaultback to summary
public static <T> CaseProcedure<T> caseDefault(Procedure<? super T> defaultProcedure)
caseDefaultback to summary
public static <T> CaseProcedure<T> caseDefault(Procedure<? super T> defaultProcedure, Predicate<? super T> predicate, Procedure<? super T> procedure)
castback to summary
public static <T> Procedure<T> cast(Procedure<T> procedure)

Allows a Java 8 lambda and method to be used in a forEach method without requiring a cast.

fromObjectIntProcedureback to summary
public static <T> Procedure<T> fromObjectIntProcedure(ObjectIntProcedure<? super T> objectIntProcedure)
fromProcedureWithIntback to summary
public static <T> Procedure<T> fromProcedureWithInt(ObjectIntProcedure<? super T> objectIntProcedure)

Deprecated

since 1.2 - Inlineable

Annotations
@Deprecated
ifElseback to summary
public static <T> Procedure<T> ifElse(Predicate<? super T> predicate, Procedure<? super T> trueProcedure, Procedure<? super T> falseProcedure)
ifTrueback to summary
public static <T> Procedure<T> ifTrue(Predicate<? super T> predicate, Procedure<? super T> block)
noopback to summary
public static <T> Procedure<T> noop()
printlnback to summary
public static <T> Procedure<T> println(PrintStream stream)
synchronizedEachback to summary
public static <T> Procedure<T> synchronizedEach(Procedure<T> procedure)
throwingback to summary
public static <T> Procedure<T> throwing(ThrowingProcedure<T> throwingProcedure)

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

throwingback to summary
public static <T> Procedure<T> throwing(ThrowingProcedure<T> throwingProcedure, Function2<T, ? 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 Procedure 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 Procedures.AppendProcedure<T>

extends Object
implements Procedure<T>
Class Inheritance
  • java.lang.Object
  • org.eclipse.collections.impl.block.factory.Procedures.AppendProcedure
All Implemented Interfaces
org.eclipse.collections.api.block.procedure.Procedure, java.io.Serializable, java.util.function.Consumer

Field Summary

Modifier and TypeField and Description
private final Appendable
private static final long

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

appendableback to summary
private final Appendable appendable
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

AppendProcedureback to summary
private AppendProcedure(Appendable appendable)

Method Detail

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
valueback to summary
public void value(T each)

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

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

private final Class Procedures.BindProcedure<T, P>

extends Object
implements Procedure<T>
Class Inheritance
  • java.lang.Object
  • org.eclipse.collections.impl.block.factory.Procedures.BindProcedure
All Implemented Interfaces
org.eclipse.collections.api.block.procedure.Procedure, java.io.Serializable, java.util.function.Consumer

Field Summary

Modifier and TypeField and Description
private final P
private final Procedure2<? super T, ? super P>
private static final long

Constructor Summary

AccessConstructor and Description
private
BindProcedure(Procedure2<? super T, ? super P> procedure, P parameter)

Method Summary

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

Field Detail

parameterback to summary
private final P parameter
procedureback to summary
private final Procedure2<? super T, ? super P> procedure
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

BindProcedureback to summary
private BindProcedure(Procedure2<? super T, ? super P> procedure, P parameter)

Method Detail

valueback to summary
public void value(T each)

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

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

private final Enum Procedures.NoopProcedure

extends Enum<Procedures.NoopProcedure>
implements Procedure<Object>
Class Inheritance
All Implemented Interfaces
org.eclipse.collections.api.block.procedure.Procedure, java.io.Serializable, java.util.function.Consumer

Field Summary

Modifier and TypeField and Description
public static final Procedures.NoopProcedure
private static final long

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
public static Procedures.NoopProcedure
public static Procedures.NoopProcedure[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INSTANCEback to summary
public static final Procedures.NoopProcedure INSTANCE
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

NoopProcedureback to summary
private NoopProcedure()

Method Detail

valueback to summary
public void value(Object each)

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

Annotations
@Override
valueOfback to summary
public static Procedures.NoopProcedure valueOf(String name)
valuesback to summary
public static Procedures.NoopProcedure[] values()
org.eclipse.collections.impl.block.factory back to summary

private final Class Procedures.ObjectIntProcedureAdapter<T>

extends Object
implements Procedure<T>
Class Inheritance
  • java.lang.Object
  • org.eclipse.collections.impl.block.factory.Procedures.ObjectIntProcedureAdapter
All Implemented Interfaces
org.eclipse.collections.api.block.procedure.Procedure, java.io.Serializable, java.util.function.Consumer

Field Summary

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

Constructor Summary

AccessConstructor and Description
private
ObjectIntProcedureAdapter(ObjectIntProcedure<? super T> objectIntProcedure)

Method Summary

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

Field Detail

countback to summary
private int count
objectIntProcedureback to summary
private final ObjectIntProcedure<? super T> objectIntProcedure
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

ObjectIntProcedureAdapterback to summary
private ObjectIntProcedureAdapter(ObjectIntProcedure<? super T> objectIntProcedure)

Method Detail

valueback to summary
public void value(T each)

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

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

private final Class Procedures.PrintlnProcedure<T>

extends Object
implements Procedure<T>
Class Inheritance
  • java.lang.Object
  • org.eclipse.collections.impl.block.factory.Procedures.PrintlnProcedure
All Implemented Interfaces
org.eclipse.collections.api.block.procedure.Procedure, java.io.Serializable, java.util.function.Consumer

Field Summary

Modifier and TypeField and Description
private static final long
private final PrintStream

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
streamback to summary
private final PrintStream stream

Constructor Detail

PrintlnProcedureback to summary
private PrintlnProcedure(PrintStream stream)

Method Detail

valueback to summary
public void value(T each)

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

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

public final Class Procedures.SynchronizedProcedure<T>

extends Object
implements Procedure<T>
Class Inheritance
  • java.lang.Object
  • org.eclipse.collections.impl.block.factory.Procedures.SynchronizedProcedure
All Implemented Interfaces
org.eclipse.collections.api.block.procedure.Procedure, java.io.Serializable, java.util.function.Consumer

Field Summary

Modifier and TypeField and Description
private final Procedure<T>
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

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

Constructor Detail

SynchronizedProcedureback to summary
private SynchronizedProcedure(Procedure<T> procedure)

Method Detail

valueback to summary
public void value(T each)

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

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

private final Class Procedures.ThrowingProcedureAdapter<T>

extends CheckedProcedure<T>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final long
private final ThrowingProcedure<T>

Constructor Summary

AccessConstructor and Description
private

Method Summary

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

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

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

throwingProcedureback to summary
private final ThrowingProcedure<T> throwingProcedure

Constructor Detail

ThrowingProcedureAdapterback to summary
private ThrowingProcedureAdapter(ThrowingProcedure<T> throwingProcedure)

Method Detail

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

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

Annotations
@Override