Top Description Constructors Methods
org.eclipse.xtext.xbase.lib

public Class ProcedureExtensions

extends Object
Class Inheritance
Annotations
@GwtCompatible
Imports
org.eclipse.xtext.xbase.lib.Procedures.Procedure0, .Procedures.Procedure1, .Procedures.Procedure2, .Procedures.Procedure3, .Procedures.Procedure4, .Procedures.Procedure5, .Procedures.Procedure6, com.google.common.annotations.GwtCompatible

This is an extension library for procedures, e.g. side-effect only-closures.
Author
Sebastian Zarnekow - Initial contribution and API
See Also
Procedures

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static <P1> Procedures.Procedure0

Returns:

a procedure that takes no arguments. Never null.
curry
(final Procedures.Procedure1<? super P1>
the original procedure. May not be null.
procedure
,
final P1
the fixed argument.
argument
)

Curries a procedure that takes one argument.

public static <P1, P2> Procedures.Procedure1<P2>

Returns:

a procedure that takes one argument. Never null.
curry
(final Procedures.Procedure2<? super P1, ? super P2>
the original procedure. May not be null.
procedure
,
final P1
the fixed first argument of procedure.
argument
)

Curries a procedure that takes two arguments.

public static <P1, P2, P3> Procedures.Procedure2<P2, P3>

Returns:

a procedure that takes two arguments. Never null.
curry
(final Procedures.Procedure3<? super P1, ? super P2, ? super P3>
the original procedure. May not be null.
procedure
,
final P1
the fixed first argument of procedure.
argument
)

Curries a procedure that takes three arguments.

public static <P1, P2, P3, P4> Procedures.Procedure3<P2, P3, P4>

Returns:

a procedure that takes three arguments. Never null.
curry
(final Procedures.Procedure4<? super P1, ? super P2, ? super P3, ? super P4>
the original procedure. May not be null.
procedure
,
final P1
the fixed first argument of procedure.
argument
)

Curries a procedure that takes four arguments.

public static <P1, P2, P3, P4, P5> Procedures.Procedure4<P2, P3, P4, P5>

Returns:

a procedure that takes four arguments. Never null.
curry
(final Procedures.Procedure5<? super P1, ? super P2, ? super P3, ? super P4, ? super P5>
the original procedure. May not be null.
procedure
,
final P1
the fixed first argument of procedure.
argument
)

Curries a procedure that takes five arguments.

public static <P1, P2, P3, P4, P5, P6> Procedures.Procedure5<P2, P3, P4, P5, P6>

Returns:

a procedure that takes five arguments. Never null.
curry
(final Procedures.Procedure6<? super P1, ? super P2, ? super P3, ? super P4, ? super P5, ? super P6>
the original procedure. May not be null.
procedure
,
final P1
the fixed first argument of procedure.
argument
)

Curries a procedure that takes six arguments.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ProcedureExtensionsback to summary
public ProcedureExtensions()

Method Detail

curryback to summary
public static <P1> Procedures.Procedure0 curry(final Procedures.Procedure1<? super P1> procedure, final P1 argument)

Curries a procedure that takes one argument.

Parameters
procedure:Procedures.Procedure1<? super P1>

the original procedure. May not be null.

argument:P1

the fixed argument.

Returns:Procedures.Procedure0

a procedure that takes no arguments. Never null.

Annotations
@Pure
curryback to summary
public static <P1, P2> Procedures.Procedure1<P2> curry(final Procedures.Procedure2<? super P1, ? super P2> procedure, final P1 argument)

Curries a procedure that takes two arguments.

Parameters
procedure:Procedures.Procedure2<? super P1, ? super P2>

the original procedure. May not be null.

argument:P1

the fixed first argument of procedure.

Returns:Procedures.Procedure1<P2>

a procedure that takes one argument. Never null.

Annotations
@Pure
curryback to summary
public static <P1, P2, P3> Procedures.Procedure2<P2, P3> curry(final Procedures.Procedure3<? super P1, ? super P2, ? super P3> procedure, final P1 argument)

Curries a procedure that takes three arguments.

Parameters
procedure:Procedures.Procedure3<? super P1, ? super P2, ? super P3>

the original procedure. May not be null.

argument:P1

the fixed first argument of procedure.

Returns:Procedures.Procedure2<P2, P3>

a procedure that takes two arguments. Never null.

Annotations
@Pure
curryback to summary
public static <P1, P2, P3, P4> Procedures.Procedure3<P2, P3, P4> curry(final Procedures.Procedure4<? super P1, ? super P2, ? super P3, ? super P4> procedure, final P1 argument)

Curries a procedure that takes four arguments.

Parameters
procedure:Procedures.Procedure4<? super P1, ? super P2, ? super P3, ? super P4>

the original procedure. May not be null.

argument:P1

the fixed first argument of procedure.

Returns:Procedures.Procedure3<P2, P3, P4>

a procedure that takes three arguments. Never null.

Annotations
@Pure
curryback to summary
public static <P1, P2, P3, P4, P5> Procedures.Procedure4<P2, P3, P4, P5> curry(final Procedures.Procedure5<? super P1, ? super P2, ? super P3, ? super P4, ? super P5> procedure, final P1 argument)

Curries a procedure that takes five arguments.

Parameters
procedure:Procedures.Procedure5<? super P1, ? super P2, ? super P3, ? super P4, ? super P5>

the original procedure. May not be null.

argument:P1

the fixed first argument of procedure.

Returns:Procedures.Procedure4<P2, P3, P4, P5>

a procedure that takes four arguments. Never null.

Annotations
@Pure
curryback to summary
public static <P1, P2, P3, P4, P5, P6> Procedures.Procedure5<P2, P3, P4, P5, P6> curry(final Procedures.Procedure6<? super P1, ? super P2, ? super P3, ? super P4, ? super P5, ? super P6> procedure, final P1 argument)

Curries a procedure that takes six arguments.

Parameters
procedure:Procedures.Procedure6<? super P1, ? super P2, ? super P3, ? super P4, ? super P5, ? super P6>

the original procedure. May not be null.

argument:P1

the fixed first argument of procedure.

Returns:Procedures.Procedure5<P2, P3, P4, P5, P6>

a procedure that takes five arguments. Never null.

Annotations
@Pure