org.op4j.operators.impl.fn.set
Class Level1SetSelectedElementsSelectedOperator<I,T>

Object
  extended by org.op4j.operators.impl.AbstractOperator
      extended by org.op4j.operators.impl.fn.set.Level1SetSelectedElementsSelectedOperator<I,T>
All Implemented Interfaces:
ILevel1SetSelectedElementsSelectedOperator<I,T>, ExecutableSelectedOperator<T>, Operator, ReplaceableOperator<T>, SelectedElementsOperator<T>, UniqFnOperator<I,Set<T>>, UniqOperator<Set<T>>

public final class Level1SetSelectedElementsSelectedOperator<I,T>
extends AbstractOperator
implements UniqFnOperator<I,Set<T>>, ILevel1SetSelectedElementsSelectedOperator<I,T>


Constructor Summary
Level1SetSelectedElementsSelectedOperator(Target target)
           
 
Method Summary
 Level1SetSelectedElementsOperator<I,T> endIf()
           Ends the selection currently active for this level.
 Level1SetSelectedElementsSelectedOperator<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.
 Function<I,Set<T>> get()
           Returns a function which will execute all the logic specified from the "Fn.on" expression.
 Level1SetSelectedElementsSelectedOperator<I,T> replaceWith(T replacement)
           Replaces the current target object with the specified replacement.
 
Methods inherited from class org.op4j.operators.impl.AbstractOperator
getTarget
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Level1SetSelectedElementsSelectedOperator

public Level1SetSelectedElementsSelectedOperator(Target target)
Method Detail

endIf

public Level1SetSelectedElementsOperator<I,T> endIf()
Description copied from interface: SelectedElementsOperator

Ends the selection currently active for this level.

Specified by:
endIf in interface ILevel1SetSelectedElementsSelectedOperator<I,T>
Specified by:
endIf in interface SelectedElementsOperator<T>
Returns:
an operator which will execute all subsequent operations on all the target objects instead of only on the previously selected ones.

exec

public Level1SetSelectedElementsSelectedOperator<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 ILevel1SetSelectedElementsSelectedOperator<I,T>
Specified by:
exec in interface ExecutableSelectedOperator<T>
Parameters:
function - the function to be executed
Returns:
an operator on the results of function execution

replaceWith

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

Replaces the current target object with the specified replacement.

Specified by:
replaceWith in interface ILevel1SetSelectedElementsSelectedOperator<I,T>
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.

get

public Function<I,Set<T>> get()
Description copied from interface: UniqFnOperator

Returns a function which will execute all the logic specified from the "Fn.on" expression.

Specified by:
get in interface UniqFnOperator<I,Set<T>>
Returns:
the function.


Copyright © 2012 The OP4J team. All Rights Reserved.