org.op4j.operators.impl.op.map
Class Level2MapEntriesSelectedKeyOperator<I,K,V>

Object
  extended by org.op4j.operators.impl.AbstractOperator
      extended by org.op4j.operators.impl.op.map.Level2MapEntriesSelectedKeyOperator<I,K,V>
All Implemented Interfaces:
ILevel2MapEntriesSelectedKeyOperator<I,K,V>, ExecutableSelectedOperator<K>, NavigatingMapEntryOperator, Operator, ReplaceableOperator<K>, SelectableMapEntryComponentOperator<K>, UniqOperator<Map<K,V>>, UniqOpOperator<I,Map<K,V>>

public final class Level2MapEntriesSelectedKeyOperator<I,K,V>
extends AbstractOperator
implements UniqOpOperator<I,Map<K,V>>, ILevel2MapEntriesSelectedKeyOperator<I,K,V>


Constructor Summary
Level2MapEntriesSelectedKeyOperator(Target target)
           
 
Method Summary
 Level1MapEntriesSelectedOperator<I,K,V> endOn()
           Stops the selection of key/value.
 Level2MapEntriesSelectedKeyOperator<I,K,V> exec(IFunction<? super K,? extends K> function)
           Executes the specified function on the target object, creating a new operator containing the result of the execution.
 Map<K,V> get()
           Returns the target object this operator currently holds.
 Level2MapEntriesSelectedKeySelectedOperator<I,K,V> ifFalse(IFunction<? super K,Boolean> eval)
           Selects only those targets for which the specified evaluator returns false.
 Level2MapEntriesSelectedKeySelectedOperator<I,K,V> ifNotNull()
           Selects only those targets which are not null.
 Level2MapEntriesSelectedKeySelectedOperator<I,K,V> ifNotNullAndFalse(IFunction<? super K,Boolean> eval)
           
 Level2MapEntriesSelectedKeySelectedOperator<I,K,V> ifNotNullAndTrue(IFunction<? super K,Boolean> eval)
           
 Level2MapEntriesSelectedKeySelectedOperator<I,K,V> ifNull()
           Selects only those targets which are null.
 Level2MapEntriesSelectedKeySelectedOperator<I,K,V> ifNullOrFalse(IFunction<? super K,Boolean> eval)
           
 Level2MapEntriesSelectedKeySelectedOperator<I,K,V> ifNullOrTrue(IFunction<? super K,Boolean> eval)
           
 Level2MapEntriesSelectedKeySelectedOperator<I,K,V> ifTrue(IFunction<? super K,Boolean> eval)
           Selects only those targets for which the specified evaluator returns true.
 Level2MapEntriesSelectedKeyOperator<I,K,V> replaceWith(K 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

Level2MapEntriesSelectedKeyOperator

public Level2MapEntriesSelectedKeyOperator(Target target)
Method Detail

ifTrue

public Level2MapEntriesSelectedKeySelectedOperator<I,K,V> ifTrue(IFunction<? super K,Boolean> eval)
Description copied from interface: SelectableMapEntryComponentOperator

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 ILevel2MapEntriesSelectedKeyOperator<I,K,V>
Specified by:
ifTrue in interface SelectableMapEntryComponentOperator<K>
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

public Level2MapEntriesSelectedKeySelectedOperator<I,K,V> ifFalse(IFunction<? super K,Boolean> eval)
Description copied from interface: SelectableMapEntryComponentOperator

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 ILevel2MapEntriesSelectedKeyOperator<I,K,V>
Specified by:
ifFalse in interface SelectableMapEntryComponentOperator<K>
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.

ifNull

public Level2MapEntriesSelectedKeySelectedOperator<I,K,V> ifNull()
Description copied from interface: SelectableMapEntryComponentOperator

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 ILevel2MapEntriesSelectedKeyOperator<I,K,V>
Specified by:
ifNull in interface SelectableMapEntryComponentOperator<K>
Returns:
an operator which will execute all subsequent operations only on the selected target objects.

ifNotNull

public Level2MapEntriesSelectedKeySelectedOperator<I,K,V> ifNotNull()
Description copied from interface: SelectableMapEntryComponentOperator

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 ILevel2MapEntriesSelectedKeyOperator<I,K,V>
Specified by:
ifNotNull in interface SelectableMapEntryComponentOperator<K>
Returns:
an operator which will execute all subsequent operations only on the selected target objects.

ifNullOrFalse

public Level2MapEntriesSelectedKeySelectedOperator<I,K,V> ifNullOrFalse(IFunction<? super K,Boolean> eval)
Specified by:
ifNullOrFalse in interface ILevel2MapEntriesSelectedKeyOperator<I,K,V>

ifNotNullAndFalse

public Level2MapEntriesSelectedKeySelectedOperator<I,K,V> ifNotNullAndFalse(IFunction<? super K,Boolean> eval)
Specified by:
ifNotNullAndFalse in interface ILevel2MapEntriesSelectedKeyOperator<I,K,V>

ifNullOrTrue

public Level2MapEntriesSelectedKeySelectedOperator<I,K,V> ifNullOrTrue(IFunction<? super K,Boolean> eval)
Specified by:
ifNullOrTrue in interface ILevel2MapEntriesSelectedKeyOperator<I,K,V>

ifNotNullAndTrue

public Level2MapEntriesSelectedKeySelectedOperator<I,K,V> ifNotNullAndTrue(IFunction<? super K,Boolean> eval)
Specified by:
ifNotNullAndTrue in interface ILevel2MapEntriesSelectedKeyOperator<I,K,V>

endOn

public Level1MapEntriesSelectedOperator<I,K,V> endOn()
Description copied from interface: NavigatingMapEntryOperator

Stops the selection of key/value. After the execution of this method, all subsequent operations will be applied on the map entry as a whole instead of only on its key or value.

Specified by:
endOn in interface ILevel2MapEntriesSelectedKeyOperator<I,K,V>
Specified by:
endOn in interface NavigatingMapEntryOperator
Returns:
an operator which will execute all operations on the map entry as a whole.

exec

public Level2MapEntriesSelectedKeyOperator<I,K,V> exec(IFunction<? super K,? extends K> 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 ILevel2MapEntriesSelectedKeyOperator<I,K,V>
Specified by:
exec in interface ExecutableSelectedOperator<K>
Parameters:
function - the function to be executed
Returns:
an operator on the results of function execution

replaceWith

public Level2MapEntriesSelectedKeyOperator<I,K,V> replaceWith(K replacement)
Description copied from interface: ReplaceableOperator

Replaces the current target object with the specified replacement.

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

get

public Map<K,V> get()
Description copied from interface: UniqOpOperator

Returns the target object this operator currently holds.

Specified by:
get in interface UniqOpOperator<I,Map<K,V>>
Returns:
the target object.


Copyright © 2012 The OP4J team. All Rights Reserved.