org.op4j.operators.qualities
Interface ExecutableOperator<T>

All Known Subinterfaces:
ILevel0GenericUniqOperator<I,T>, ILevel2MapEntriesKeyOperator<I,K,V>, ILevel2MapEntriesValueOperator<I,K,V>
All Known Implementing Classes:
Level0GenericUniqOperator, Level0GenericUniqOperator, Level2MapEntriesKeyOperator, Level2MapEntriesKeyOperator, Level2MapEntriesValueOperator, Level2MapEntriesValueOperator

public interface ExecutableOperator<T>

This interface contains methods for executing functions.

Since:
1.0
Author:
Daniel Fernández

Method Summary
<X> ExecutableOperator<X>
exec(IFunction<? super T,X> function)
           Executes the specified function on the target object, creating a new operator containing the result of the execution.
 ExecutableOperator<T> execIfFalse(IFunction<? super T,Boolean> eval, IFunction<? super T,? extends T> function)
           Executes a function in a way equivalent to exec(IFunction) but only on selected elements, leaving all other elements untouched.
<X> ExecutableOperator<X>
execIfFalse(IFunction<? super T,Boolean> eval, IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
           Executes a function in a way equivalent to exec(IFunction) but only on selected elements, leaving all other elements untouched.
 ExecutableOperator<T> execIfNotNull(IFunction<? super T,? extends T> function)
           Executes a function in a way equivalent to exec(IFunction) but only on selected elements, leaving all other elements untouched.
<X> ExecutableOperator<X>
execIfNotNull(IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
           Executes a function in a way equivalent to exec(IFunction) but only on selected elements, leaving all other elements untouched.
 ExecutableOperator<T> execIfNull(IFunction<? super T,? extends T> function)
           Executes a function in a way equivalent to exec(IFunction) but only on selected elements, leaving all other elements untouched.
<X> ExecutableOperator<X>
execIfNull(IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
           Executes a function in a way equivalent to exec(IFunction) but only on selected elements, leaving all other elements untouched.
 ExecutableOperator<T> execIfTrue(IFunction<? super T,Boolean> eval, IFunction<? super T,? extends T> function)
           Executes a function in a way equivalent to exec(IFunction) but only on selected elements, leaving all other elements untouched.
<X> ExecutableOperator<X>
execIfTrue(IFunction<? super T,Boolean> eval, IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
           Executes a function in a way equivalent to exec(IFunction) but only on selected elements, leaving all other elements untouched.
 

Method Detail

exec

<X> ExecutableOperator<X> exec(IFunction<? super T,X> function)

Executes the specified function on the target object, creating a new operator containing the result of the execution.

This function must be able to take as input an object of type T (the current operator's target type) and will return an object of type X, which will be from then on the new operator's target type.

Type Parameters:
X - the type of the result, and new type for the operator
Parameters:
function - the function to be executed
Returns:
an operator on the results of function execution

execIfNotNull

ExecutableOperator<T> execIfNotNull(IFunction<? super T,? extends T> function)

Executes a function in a way equivalent to exec(IFunction) but only on selected elements, leaving all other elements untouched.

Parameters:
function - the function to be executed on the selected elements
Returns:
an operator on the results of function execution

execIfNull

ExecutableOperator<T> execIfNull(IFunction<? super T,? extends T> function)

Executes a function in a way equivalent to exec(IFunction) but only on selected elements, leaving all other elements untouched.

Parameters:
function - the function to be executed on the selected elements
Returns:
an operator on the results of function execution

execIfTrue

ExecutableOperator<T> execIfTrue(IFunction<? super T,Boolean> eval,
                                 IFunction<? super T,? extends T> function)

Executes a function in a way equivalent to exec(IFunction) but only on selected elements, leaving all other elements untouched.

Parameters:
eval - the evaluation function used to select elements
function - the function to be executed on the selected elements
Returns:
an operator on the results of function execution

execIfFalse

ExecutableOperator<T> execIfFalse(IFunction<? super T,Boolean> eval,
                                  IFunction<? super T,? extends T> function)

Executes a function in a way equivalent to exec(IFunction) but only on selected elements, leaving all other elements untouched.

Parameters:
eval - the evaluation function used to select elements
function - the function to be executed on the selected elements
Returns:
an operator on the results of function execution

execIfNotNull

<X> ExecutableOperator<X> execIfNotNull(IFunction<? super T,X> function,
                                        IFunction<? super T,X> elseFunction)

Executes a function in a way equivalent to exec(IFunction) but only on selected elements, leaving all other elements untouched.

Type Parameters:
X - the new type returned by the functions
Parameters:
function - the function to be executed on the selected elements
elseFunction - the function to be executed on the non-selected elements
Returns:
an operator on the results of function execution

execIfNull

<X> ExecutableOperator<X> execIfNull(IFunction<? super T,X> function,
                                     IFunction<? super T,X> elseFunction)

Executes a function in a way equivalent to exec(IFunction) but only on selected elements, leaving all other elements untouched.

Type Parameters:
X - the new type returned by the functions
Parameters:
function - the function to be executed on the selected elements
elseFunction - the function to be executed on the non-selected elements
Returns:
an operator on the results of function execution

execIfTrue

<X> ExecutableOperator<X> execIfTrue(IFunction<? super T,Boolean> eval,
                                     IFunction<? super T,X> function,
                                     IFunction<? super T,X> elseFunction)

Executes a function in a way equivalent to exec(IFunction) but only on selected elements, leaving all other elements untouched.

Type Parameters:
X - the new type returned by the functions
Parameters:
eval - the evaluation function used to select elements
function - the function to be executed on the selected elements
elseFunction - the function to be executed on the non-selected elements
Returns:
an operator on the results of function execution

execIfFalse

<X> ExecutableOperator<X> execIfFalse(IFunction<? super T,Boolean> eval,
                                      IFunction<? super T,X> function,
                                      IFunction<? super T,X> elseFunction)

Executes a function in a way equivalent to exec(IFunction) but only on selected elements, leaving all other elements untouched.

Type Parameters:
X - the new type returned by the functions
Parameters:
eval - the evaluation function used to select elements
function - the function to be executed on the selected elements
elseFunction - the function to be executed on the non-selected elements
Returns:
an operator on the results of function execution


Copyright © 2012 The OP4J team. All Rights Reserved.