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

All Known Subinterfaces:
ILevel0ArrayOperator<I,T>
All Known Implementing Classes:
Level0ArrayOperator, Level0ArrayOperator

public interface ExecutableArrayOperator<T>

This interface contains methods for executing functions on operators with array target objects.

Since:
1.0
Author:
Daniel Fernández

Method Summary
<X> Operator
exec(IFunction<? super T[],X> function)
           Executes the specified function on the target object, creating a new generic operator containing the result of the execution and setting the new operator type to the one specified.
 ExecutableArrayOperator<T> execAsArray(IFunction<? super T[],? extends T[]> function)
           Executes the specified function on the target object, creating a new operator containing the result of the execution.
<X> ExecutableArrayOperator<X>
execAsArrayOf(org.javaruntype.type.Type<X> type, IFunction<? super T[],X[]> function)
           Executes the specified function on the target object, creating a new operator containing the result of the execution.
 ExecutableArrayOperator<T> execIfFalseAsArray(IFunction<? super T[],Boolean> eval, IFunction<? super T[],? extends T[]> function)
           Executes a function in a way equivalent to execAsArray(IFunction) but only on selected elements, leaving all other elements untouched.
<X> ExecutableArrayOperator<X>
execIfFalseAsArrayOf(org.javaruntype.type.Type<X> type, IFunction<? super T[],Boolean> eval, IFunction<? super T[],X[]> function, IFunction<? super T[],X[]> elseFunction)
           Executes a function in a way equivalent to execAsArray(IFunction) but only on selected elements, leaving all other elements untouched.
 ExecutableArrayOperator<T> execIfNotNullAsArray(IFunction<? super T[],? extends T[]> function)
           Executes a function in a way equivalent to execAsArray(IFunction) but only on selected elements, leaving all other elements untouched.
<X> ExecutableArrayOperator<X>
execIfNotNullAsArrayOf(org.javaruntype.type.Type<X> type, IFunction<? super T[],X[]> function, IFunction<? super T[],X[]> elseFunction)
           Executes a function in a way equivalent to execAsArray(IFunction) but only on selected elements, leaving all other elements untouched.
 ExecutableArrayOperator<T> execIfNullAsArray(IFunction<? super T[],? extends T[]> function)
           Executes a function in a way equivalent to execAsArray(IFunction) but only on selected elements, leaving all other elements untouched.
<X> ExecutableArrayOperator<X>
execIfNullAsArrayOf(org.javaruntype.type.Type<X> type, IFunction<? super T[],X[]> function, IFunction<? super T[],X[]> elseFunction)
           Executes a function in a way equivalent to execAsArray(IFunction) but only on selected elements, leaving all other elements untouched.
 ExecutableArrayOperator<T> execIfTrueAsArray(IFunction<? super T[],Boolean> eval, IFunction<? super T[],? extends T[]> function)
           Executes a function in a way equivalent to execAsArray(IFunction) but only on selected elements, leaving all other elements untouched.
<X> ExecutableArrayOperator<X>
execIfTrueAsArrayOf(org.javaruntype.type.Type<X> type, IFunction<? super T[],Boolean> eval, IFunction<? super T[],X[]> function, IFunction<? super T[],X[]> elseFunction)
           Executes a function in a way equivalent to execAsArray(IFunction) but only on selected elements, leaving all other elements untouched.
 ExecutableArrayOperator<T> map(IFunction<? super T,? extends T> function)
           Executes the specified function on each of the elements, creating a new operator containing the result of all the executions but not changing the operator type.
<X> ExecutableArrayOperator<X>
map(org.javaruntype.type.Type<X> type, IFunction<? super T,X> function)
           Executes the specified function on each of the elements, creating a new operator containing the result of all the executions and setting the new operator type to the one specified.
 ExecutableArrayOperator<T> mapIfFalse(IFunction<? super T,Boolean> eval, IFunction<? super T,? extends T> function)
           Maps a function in a way equivalent to map(IFunction) but only on selected elements, leaving all other elements untouched.
<X> ExecutableArrayOperator<X>
mapIfFalse(org.javaruntype.type.Type<X> type, IFunction<? super T,Boolean> eval, IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
           Maps a function in a way equivalent to map(IFunction) but only on selected elements, leaving all other elements untouched.
 ExecutableArrayOperator<T> mapIfNotNull(IFunction<? super T,? extends T> function)
           Maps a function in a way equivalent to map(IFunction) but only on selected elements, leaving all other elements untouched.
<X> ExecutableArrayOperator<X>
mapIfNotNull(org.javaruntype.type.Type<X> type, IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
           Maps a function in a way equivalent to map(IFunction) but only on selected elements, leaving all other elements untouched.
 ExecutableArrayOperator<T> mapIfNull(IFunction<? super T,? extends T> function)
           Maps a function in a way equivalent to map(IFunction) but only on selected elements, leaving all other elements untouched.
<X> ExecutableArrayOperator<X>
mapIfNull(org.javaruntype.type.Type<X> type, IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
           Maps a function in a way equivalent to map(IFunction) but only on selected elements, leaving all other elements untouched.
 ExecutableArrayOperator<T> mapIfTrue(IFunction<? super T,Boolean> eval, IFunction<? super T,? extends T> function)
           Maps a function in a way equivalent to map(IFunction) but only on selected elements, leaving all other elements untouched.
<X> ExecutableArrayOperator<X>
mapIfTrue(org.javaruntype.type.Type<X> type, IFunction<? super T,Boolean> eval, IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
           Maps a function in a way equivalent to map(IFunction) but only on selected elements, leaving all other elements untouched.
 

Method Detail

execAsArray

ExecutableArrayOperator<T> execAsArray(IFunction<? super T[],? extends T[]> 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 array of the current operator's target type, and will return an array of the same type and structure.

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

execAsArrayOf

<X> ExecutableArrayOperator<X> execAsArrayOf(org.javaruntype.type.Type<X> type,
                                             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 array of the current operator's target type, and can return an array of a different type (specified by the type parameter), which will be from then on the new operator's target type.

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

execIfNotNullAsArray

ExecutableArrayOperator<T> execIfNotNullAsArray(IFunction<? super T[],? extends T[]> function)

Executes a function in a way equivalent to execAsArray(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

execIfNullAsArray

ExecutableArrayOperator<T> execIfNullAsArray(IFunction<? super T[],? extends T[]> function)

Executes a function in a way equivalent to execAsArray(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

execIfTrueAsArray

ExecutableArrayOperator<T> execIfTrueAsArray(IFunction<? super T[],Boolean> eval,
                                             IFunction<? super T[],? extends T[]> function)

Executes a function in a way equivalent to execAsArray(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

execIfFalseAsArray

ExecutableArrayOperator<T> execIfFalseAsArray(IFunction<? super T[],Boolean> eval,
                                              IFunction<? super T[],? extends T[]> function)

Executes a function in a way equivalent to execAsArray(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

execIfNotNullAsArrayOf

<X> ExecutableArrayOperator<X> execIfNotNullAsArrayOf(org.javaruntype.type.Type<X> type,
                                                      IFunction<? super T[],X[]> function,
                                                      IFunction<? super T[],X[]> elseFunction)

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

Type Parameters:
X - the new type returned by the functions
Parameters:
type - the new type returned by the functions
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

execIfNullAsArrayOf

<X> ExecutableArrayOperator<X> execIfNullAsArrayOf(org.javaruntype.type.Type<X> type,
                                                   IFunction<? super T[],X[]> function,
                                                   IFunction<? super T[],X[]> elseFunction)

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

Type Parameters:
X - the new type returned by the functions
Parameters:
type - the new type returned by the functions
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

execIfTrueAsArrayOf

<X> ExecutableArrayOperator<X> execIfTrueAsArrayOf(org.javaruntype.type.Type<X> type,
                                                   IFunction<? super T[],Boolean> eval,
                                                   IFunction<? super T[],X[]> function,
                                                   IFunction<? super T[],X[]> elseFunction)

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

Type Parameters:
X - the new type returned by the functions
Parameters:
type - the new type returned by the functions
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

execIfFalseAsArrayOf

<X> ExecutableArrayOperator<X> execIfFalseAsArrayOf(org.javaruntype.type.Type<X> type,
                                                    IFunction<? super T[],Boolean> eval,
                                                    IFunction<? super T[],X[]> function,
                                                    IFunction<? super T[],X[]> elseFunction)

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

Type Parameters:
X - the new type returned by the functions
Parameters:
type - the new type returned by the functions
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

exec

<X> Operator exec(IFunction<? super T[],X> function)

Executes the specified function on the target object, creating a new generic operator containing the result of the execution and setting the new operator type to the one specified.

Type Parameters:
X - the type of the result object
Parameters:
function - the function to be executed
Returns:
an operator on the results of function execution

map

<X> ExecutableArrayOperator<X> map(org.javaruntype.type.Type<X> type,
                                   IFunction<? super T,X> function)

Executes the specified function on each of the elements, creating a new operator containing the result of all the executions and setting the new operator type to the one specified.

This method is equivalent to forEach().exec(type, function).endFor().

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

map

ExecutableArrayOperator<T> map(IFunction<? super T,? extends T> function)

Executes the specified function on each of the elements, creating a new operator containing the result of all the executions but not changing the operator type. The specified function will have to return results compatible with the current operator type.

This method is equivalent to forEach().exec(function).endFor().

Parameters:
function - the function to be executed
Returns:
an operator on the results of function execution on each element

mapIfNotNull

ExecutableArrayOperator<T> mapIfNotNull(IFunction<? super T,? extends T> function)

Maps a function in a way equivalent to map(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

mapIfNull

ExecutableArrayOperator<T> mapIfNull(IFunction<? super T,? extends T> function)

Maps a function in a way equivalent to map(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

mapIfTrue

ExecutableArrayOperator<T> mapIfTrue(IFunction<? super T,Boolean> eval,
                                     IFunction<? super T,? extends T> function)

Maps a function in a way equivalent to map(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

mapIfFalse

ExecutableArrayOperator<T> mapIfFalse(IFunction<? super T,Boolean> eval,
                                      IFunction<? super T,? extends T> function)

Maps a function in a way equivalent to map(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

mapIfNotNull

<X> ExecutableArrayOperator<X> mapIfNotNull(org.javaruntype.type.Type<X> type,
                                            IFunction<? super T,X> function,
                                            IFunction<? super T,X> elseFunction)

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

Type Parameters:
X - the new type returned by the functions
Parameters:
type - the new type returned by the functions
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

mapIfNull

<X> ExecutableArrayOperator<X> mapIfNull(org.javaruntype.type.Type<X> type,
                                         IFunction<? super T,X> function,
                                         IFunction<? super T,X> elseFunction)

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

Type Parameters:
X - the new type returned by the functions
Parameters:
type - the new type returned by the functions
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

mapIfTrue

<X> ExecutableArrayOperator<X> mapIfTrue(org.javaruntype.type.Type<X> type,
                                         IFunction<? super T,Boolean> eval,
                                         IFunction<? super T,X> function,
                                         IFunction<? super T,X> elseFunction)

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

Type Parameters:
X - the new type returned by the functions
Parameters:
type - the new type returned by the functions
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

mapIfFalse

<X> ExecutableArrayOperator<X> mapIfFalse(org.javaruntype.type.Type<X> type,
                                          IFunction<? super T,Boolean> eval,
                                          IFunction<? super T,X> function,
                                          IFunction<? super T,X> elseFunction)

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

Type Parameters:
X - the new type returned by the functions
Parameters:
type - the new type returned by the functions
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.