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

All Superinterfaces:
ExecutableMapEntrySelectedOperator<K,V>, NavigableMapEntryOperator, Operator, ReplaceableOperator<Map.Entry<K,V>>, SelectedMapEntryOperator<K,V>, UniqOperator<Map<K,V>>
All Known Implementing Classes:
Level1MapEntriesSelectedOperator, Level1MapEntriesSelectedOperator

public interface ILevel1MapEntriesSelectedOperator<I,K,V>
extends UniqOperator<Map<K,V>>, NavigableMapEntryOperator, ExecutableMapEntrySelectedOperator<K,V>, ReplaceableOperator<Map.Entry<K,V>>, SelectedMapEntryOperator<K,V>

Since:
1.0
Author:
Daniel Fernández

Method Summary
 ILevel1MapEntriesOperator<I,K,V> endIf()
           Ends the selection currently active for this level.
 ILevel1MapEntriesSelectedOperator<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.
 ILevel2MapEntriesSelectedKeyOperator<I,K,V> onKey()
           Accesses the key of a map entry.
 ILevel2MapEntriesSelectedValueOperator<I,K,V> onValue()
           Accesses the value of a map entry.
 ILevel1MapEntriesSelectedOperator<I,K,V> replaceWith(Map.Entry<K,V> replacement)
           Replaces the current target object with the specified replacement.
 

Method Detail

endIf

ILevel1MapEntriesOperator<I,K,V> endIf()
Description copied from interface: SelectedMapEntryOperator

Ends the selection currently active for this level.

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

onKey

ILevel2MapEntriesSelectedKeyOperator<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

ILevel2MapEntriesSelectedValueOperator<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.

replaceWith

ILevel1MapEntriesSelectedOperator<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

ILevel1MapEntriesSelectedOperator<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.