org.op4j.operators.intf.map
Interface ILevel1MapSelectedEntriesOperator<I,K,V>

All Superinterfaces:
ExecutableMapEntrySelectedOperator<K,V>, NavigableMapEntryOperator, NavigatingMapOperator<K,V>, Operator, ReplaceableOperator<Map.Entry<K,V>>, SelectableMapEntryOperator<K,V>, UniqOperator<Map<K,V>>
All Known Implementing Classes:
Level1MapSelectedEntriesOperator, Level1MapSelectedEntriesOperator

public interface ILevel1MapSelectedEntriesOperator<I,K,V>
extends UniqOperator<Map<K,V>>, NavigableMapEntryOperator, NavigatingMapOperator<K,V>, ExecutableMapEntrySelectedOperator<K,V>, ReplaceableOperator<Map.Entry<K,V>>, SelectableMapEntryOperator<K,V>

Since:
1.0
Author:
Daniel Fernández

Method Summary
 ILevel0MapSelectedOperator<I,K,V> endFor()
           Ends the current iteration.
 ILevel1MapSelectedEntriesOperator<I,K,V> execAsMapEntry(IFunction<? super Map.Entry<K,V>,? extends Map.Entry<? extends K,? extends V>> function)
           Executes the specified function on the target mape entry, creating a new map entry operator containing the result of the execution.
 ILevel1MapSelectedEntriesSelectedOperator<I,K,V> ifFalse(IFunction<? super Map.Entry<K,V>,Boolean> eval)
           Selects only those targets for which the specified evaluator returns false.
 ILevel1MapSelectedEntriesSelectedOperator<I,K,V> ifIndex(int... indexes)
           Selects only those targets which index in the current level of iteration matches any of the specified indexes.
 ILevel1MapSelectedEntriesSelectedOperator<I,K,V> ifIndexNot(int... indexes)
           Selects only those targets which index in the current level of iteration does not match any of the specified indexes.
 ILevel1MapSelectedEntriesSelectedOperator<I,K,V> ifKeyEquals(K... keys)
           Selects only those entries which key matches any of the specified values.
 ILevel1MapSelectedEntriesSelectedOperator<I,K,V> ifKeyNotEquals(K... keys)
           Selects only those entries which key does not match any of the specified values.
 ILevel1MapSelectedEntriesSelectedOperator<I,K,V> ifTrue(IFunction<? super Map.Entry<K,V>,Boolean> eval)
           Selects only those targets for which the specified evaluator returns true.
 ILevel2MapSelectedEntriesKeyOperator<I,K,V> onKey()
           Accesses the key of a map entry.
 ILevel2MapSelectedEntriesValueOperator<I,K,V> onValue()
           Accesses the value of a map entry.
 ILevel1MapSelectedEntriesOperator<I,K,V> replaceWith(Map.Entry<K,V> replacement)
           Replaces the current target object with the specified replacement.
 

Method Detail

ifIndex

ILevel1MapSelectedEntriesSelectedOperator<I,K,V> ifIndex(int... indexes)
Description copied from interface: SelectableMapEntryOperator

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 SelectableMapEntryOperator<K,V>
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

ILevel1MapSelectedEntriesSelectedOperator<I,K,V> ifTrue(IFunction<? super Map.Entry<K,V>,Boolean> eval)
Description copied from interface: SelectableMapEntryOperator

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 SelectableMapEntryOperator<K,V>
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

ILevel1MapSelectedEntriesSelectedOperator<I,K,V> ifFalse(IFunction<? super Map.Entry<K,V>,Boolean> eval)
Description copied from interface: SelectableMapEntryOperator

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 SelectableMapEntryOperator<K,V>
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.

ifIndexNot

ILevel1MapSelectedEntriesSelectedOperator<I,K,V> ifIndexNot(int... indexes)
Description copied from interface: SelectableMapEntryOperator

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 SelectableMapEntryOperator<K,V>
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.

ifKeyEquals

ILevel1MapSelectedEntriesSelectedOperator<I,K,V> ifKeyEquals(K... keys)
Description copied from interface: SelectableMapEntryOperator

Selects only those entries which key matches any of the specified values. 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:
ifKeyEquals in interface SelectableMapEntryOperator<K,V>
Parameters:
keys - the key values to be matched
Returns:
an operator which will execute all subsequent operations only on the selected target objects.

ifKeyNotEquals

ILevel1MapSelectedEntriesSelectedOperator<I,K,V> ifKeyNotEquals(K... keys)
Description copied from interface: SelectableMapEntryOperator

Selects only those entries which key does not match any of the specified values. 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:
ifKeyNotEquals in interface SelectableMapEntryOperator<K,V>
Parameters:
keys - the key values to be matched
Returns:
an operator which will execute all subsequent operations only on the selected target objects.

onKey

ILevel2MapSelectedEntriesKeyOperator<I,K,V> onKey()
Description copied from interface: NavigableMapEntryOperator

Accesses the key of a map entry. After the execution of this method, all subsequent operations will be performed on the map entry's key, until an "endOn()" method is executed.

Specified by:
onKey in interface NavigableMapEntryOperator
Returns:
an operator which will execute all operations on the key of the map entry.

onValue

ILevel2MapSelectedEntriesValueOperator<I,K,V> onValue()
Description copied from interface: NavigableMapEntryOperator

Accesses the value of a map entry. After the execution of this method, all subsequent operations will be performed on the map entry's value, until an "endOn()" method is executed.

Specified by:
onValue in interface NavigableMapEntryOperator
Returns:
an operator which will execute all operations on the value of the map entry.

endFor

ILevel0MapSelectedOperator<I,K,V> endFor()
Description copied from interface: NavigatingMapOperator

Ends the current iteration. After the execution of this method, all subsequent operations will be applied on the iterated map as a whole instead of each entry.

Specified by:
endFor in interface NavigatingMapOperator<K,V>
Returns:
an operator which will execute all operations on the iterated map as a whole.

replaceWith

ILevel1MapSelectedEntriesOperator<I,K,V> replaceWith(Map.Entry<K,V> replacement)
Description copied from interface: ReplaceableOperator

Replaces the current target object with the specified replacement.

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

execAsMapEntry

ILevel1MapSelectedEntriesOperator<I,K,V> execAsMapEntry(IFunction<? super Map.Entry<K,V>,? extends Map.Entry<? extends K,? extends V>> function)
Description copied from interface: ExecutableMapEntrySelectedOperator

Executes the specified function on the target mape entry, creating a new map entry 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:
execAsMapEntry in interface ExecutableMapEntrySelectedOperator<K,V>
Parameters:
function - the function to be executed
Returns:
an operator on the results of function execution


Copyright © 2012 The OP4J team. All Rights Reserved.