org.op4j.operators.intf.list
Interface ILevel1ListSelectedElementsOperator<I,T>

All Superinterfaces:
ExecutableSelectedOperator<T>, NavigatingCollectionOperator<T>, Operator, ReplaceableOperator<T>, SelectableElementsOperator<T>, UniqOperator<List<T>>
All Known Implementing Classes:
Level1ListSelectedElementsOperator, Level1ListSelectedElementsOperator

public interface ILevel1ListSelectedElementsOperator<I,T>
extends UniqOperator<List<T>>, NavigatingCollectionOperator<T>, SelectableElementsOperator<T>, ExecutableSelectedOperator<T>, ReplaceableOperator<T>

Since:
1.0
Author:
Daniel Fernández

Method Summary
 ILevel0ListSelectedOperator<I,T> endFor()
           Ends the current iteration.
 ILevel1ListSelectedElementsOperator<I,T> exec(IFunction<? super T,? extends T> function)
           Executes the specified function on the target object, creating a new operator containing the result of the execution.
 ILevel1ListSelectedElementsSelectedOperator<I,T> ifFalse(IFunction<? super T,Boolean> eval)
           Selects only those targets for which the specified evaluator returns false.
 ILevel1ListSelectedElementsSelectedOperator<I,T> ifIndex(int... indexes)
           Selects only those targets which index in the current level of iteration matches any of the specified indexes.
 ILevel1ListSelectedElementsSelectedOperator<I,T> ifIndexNot(int... indexes)
           Selects only those targets which index in the current level of iteration does not match any of the specified indexes.
 ILevel1ListSelectedElementsSelectedOperator<I,T> ifNotNull()
           Selects only those targets which are not null.
 ILevel1ListSelectedElementsSelectedOperator<I,T> ifNotNullAndFalse(IFunction<? super T,Boolean> eval)
           
 ILevel1ListSelectedElementsSelectedOperator<I,T> ifNotNullAndTrue(IFunction<? super T,Boolean> eval)
           
 ILevel1ListSelectedElementsSelectedOperator<I,T> ifNull()
           Selects only those targets which are null.
 ILevel1ListSelectedElementsSelectedOperator<I,T> ifNullOrFalse(IFunction<? super T,Boolean> eval)
           
 ILevel1ListSelectedElementsSelectedOperator<I,T> ifNullOrTrue(IFunction<? super T,Boolean> eval)
           
 ILevel1ListSelectedElementsSelectedOperator<I,T> ifTrue(IFunction<? super T,Boolean> eval)
           Selects only those targets for which the specified evaluator returns true.
 ILevel1ListSelectedElementsOperator<I,T> replaceWith(T replacement)
           Replaces the current target object with the specified replacement.
 

Method Detail

ifIndex

ILevel1ListSelectedElementsSelectedOperator<I,T> ifIndex(int... indexes)
Description copied from interface: SelectableElementsOperator

Selects only those targets which index in the current level of iteration matches any of the specified indexes. After this method, all the subsequently executed operations will only be executed on the target objects selected here, until an "endIf()" method is called.

Specified by:
ifIndex in interface SelectableElementsOperator<T>
Parameters:
indexes - the indexes of the target objects which will be selected.
Returns:
an operator which will execute all subsequent operations only on the selected target objects.

ifTrue

ILevel1ListSelectedElementsSelectedOperator<I,T> ifTrue(IFunction<? super T,Boolean> eval)
Description copied from interface: SelectableElementsOperator

Selects only those targets for which the specified evaluator returns true. After this method, all the subsequently executed operations will only be executed on the target objects selected here, until an "endIf()" method is called.

Specified by:
ifTrue in interface SelectableElementsOperator<T>
Parameters:
eval - the evaluator to be used for selecting targets.
Returns:
an operator which will execute all subsequent operations only on the selected target objects.

ifFalse

ILevel1ListSelectedElementsSelectedOperator<I,T> ifFalse(IFunction<? super T,Boolean> eval)
Description copied from interface: SelectableElementsOperator

Selects only those targets for which the specified evaluator returns false. After this method, all the subsequently executed operations will only be executed on the target objects selected here, until an "endIf()" method is called.

Specified by:
ifFalse in interface SelectableElementsOperator<T>
Parameters:
eval - the evaluator to be used for selecting targets.
Returns:
an operator which will execute all subsequent operations only on the selected target objects.

ifNullOrFalse

ILevel1ListSelectedElementsSelectedOperator<I,T> ifNullOrFalse(IFunction<? super T,Boolean> eval)

ifNotNullAndFalse

ILevel1ListSelectedElementsSelectedOperator<I,T> ifNotNullAndFalse(IFunction<? super T,Boolean> eval)

ifNull

ILevel1ListSelectedElementsSelectedOperator<I,T> ifNull()
Description copied from interface: SelectableElementsOperator

Selects only those targets which are null. After this method, all the subsequently executed operations will only be executed on the target objects selected here, until an "endIf()" method is called.

Specified by:
ifNull in interface SelectableElementsOperator<T>
Returns:
an operator which will execute all subsequent operations only on the selected target objects.

ifNullOrTrue

ILevel1ListSelectedElementsSelectedOperator<I,T> ifNullOrTrue(IFunction<? super T,Boolean> eval)

ifIndexNot

ILevel1ListSelectedElementsSelectedOperator<I,T> ifIndexNot(int... indexes)
Description copied from interface: SelectableElementsOperator

Selects only those targets which index in the current level of iteration does not match any of the specified indexes. After this method, all the subsequently executed operations will only be executed on the target objects selected here, until an "endIf()" method is called.

Specified by:
ifIndexNot in interface SelectableElementsOperator<T>
Parameters:
indexes - the indexes of the target objects which will be selected.
Returns:
an operator which will execute all subsequent operations only on the selected target objects.

ifNotNull

ILevel1ListSelectedElementsSelectedOperator<I,T> ifNotNull()
Description copied from interface: SelectableElementsOperator

Selects only those targets which are not null. After this method, all the subsequently executed operations will only be executed on the target objects selected here, until an "endIf()" method is called.

Specified by:
ifNotNull in interface SelectableElementsOperator<T>
Returns:
an operator which will execute all subsequent operations only on the selected target objects.

ifNotNullAndTrue

ILevel1ListSelectedElementsSelectedOperator<I,T> ifNotNullAndTrue(IFunction<? super T,Boolean> eval)

endFor

ILevel0ListSelectedOperator<I,T> endFor()
Description copied from interface: NavigatingCollectionOperator

Ends the current iteration. After the execution of this method, all subsequent operations will be applied on the iterated collection as a whole instead of in a by-element basis.

Specified by:
endFor in interface NavigatingCollectionOperator<T>
Returns:
an operator which will execute all operations on the iterated collection as a whole.

replaceWith

ILevel1ListSelectedElementsOperator<I,T> replaceWith(T replacement)
Description copied from interface: ReplaceableOperator

Replaces the current target object with the specified replacement.

Specified by:
replaceWith in interface ReplaceableOperator<T>
Parameters:
replacement - the object which will replace the current target object.
Returns:
an operator containing the replacement object as target.

exec

ILevel1ListSelectedElementsOperator<I,T> exec(IFunction<? super T,? extends T> function)
Description copied from interface: ExecutableSelectedOperator

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

This function does not allow the operator target type to change because a selection ("if") has already been done on the target objects, and this would render the operator inconsistent (some objects would belong to a type and others to another type).

Specified by:
exec in interface ExecutableSelectedOperator<T>
Parameters:
function - the function to be executed
Returns:
an operator on the results of function execution


Copyright © 2012 The OP4J team. All Rights Reserved.