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

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

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

Since:
1.0
Author:
Daniel Fernández

Method Summary
 ILevel0MapOperator<I,K,V> endFor()
           Ends the current iteration.
<X> ILevel1ListElementsOperator<I,X>
exec(IFunction<? super Map.Entry<K,V>,X> function)
           Executes the specified function on the target map entry, creating a new generic operator containing the result of the execution and setting the new operator type to the one specified.
<X,Y> ILevel1MapEntriesOperator<I,X,Y>
execAsMapEntry(IFunction<? super Map.Entry<K,V>,? extends Map.Entry<X,Y>> function)
           Executes the specified function on the target object, creating a new map entry operator containing the result of the execution.
 ILevel1MapEntriesOperator<I,K,V> execIfFalseAsMapEntry(IFunction<? super Map.Entry<K,V>,Boolean> eval, IFunction<? super Map.Entry<K,V>,? extends Map.Entry<? extends K,? extends V>> function)
           Executes a function in a way equivalent to ExecutableMapEntryOperator.execAsMapEntry(IFunction) but only on selected elements, leaving all other elements untouched.
<X,Y> ILevel1MapEntriesOperator<I,X,Y>
execIfFalseAsMapEntry(IFunction<? super Map.Entry<K,V>,Boolean> eval, IFunction<? super Map.Entry<K,V>,? extends Map.Entry<X,Y>> function, IFunction<? super Map.Entry<K,V>,? extends Map.Entry<X,Y>> elseFunction)
           Executes a function in a way equivalent to ExecutableMapEntryOperator.execAsMapEntry(IFunction) but only on selected elements, leaving all other elements untouched.
 ILevel1MapEntriesOperator<I,K,V> execIfTrueAsMapEntry(IFunction<? super Map.Entry<K,V>,Boolean> eval, IFunction<? super Map.Entry<K,V>,? extends Map.Entry<? extends K,? extends V>> function)
           Executes a function in a way equivalent to ExecutableMapEntryOperator.execAsMapEntry(IFunction) but only on selected elements, leaving all other elements untouched.
<X,Y> ILevel1MapEntriesOperator<I,X,Y>
execIfTrueAsMapEntry(IFunction<? super Map.Entry<K,V>,Boolean> eval, IFunction<? super Map.Entry<K,V>,? extends Map.Entry<X,Y>> function, IFunction<? super Map.Entry<K,V>,? extends Map.Entry<X,Y>> elseFunction)
           Executes a function in a way equivalent to ExecutableMapEntryOperator.execAsMapEntry(IFunction) but only on selected elements, leaving all other elements untouched.
 ILevel1MapEntriesSelectedOperator<I,K,V> ifFalse(IFunction<? super Map.Entry<K,V>,Boolean> eval)
           Selects only those targets for which the specified evaluator returns false.
 ILevel1MapEntriesSelectedOperator<I,K,V> ifIndex(int... indexes)
           Selects only those targets which index in the current level of iteration matches any of the specified indexes.
 ILevel1MapEntriesSelectedOperator<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.
 ILevel1MapEntriesSelectedOperator<I,K,V> ifKeyEquals(K... keys)
           Selects only those entries which key matches any of the specified values.
 ILevel1MapEntriesSelectedOperator<I,K,V> ifKeyNotEquals(K... keys)
           Selects only those entries which key does not match any of the specified values.
 ILevel1MapEntriesSelectedOperator<I,K,V> ifTrue(IFunction<? super Map.Entry<K,V>,Boolean> eval)
           Selects only those targets for which the specified evaluator returns true.
 ILevel2MapEntriesKeyOperator<I,K,V> onKey()
           Accesses the key of a map entry.
 ILevel2MapEntriesValueOperator<I,K,V> onValue()
           Accesses the value of a map entry.
 ILevel1MapEntriesOperator<I,K,V> replaceWith(Map.Entry<K,V> replacement)
           Replaces the current target object with the specified replacement.
 

Method Detail

ifIndex

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

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

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

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

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

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

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

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

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

execAsMapEntry

<X,Y> ILevel1MapEntriesOperator<I,X,Y> execAsMapEntry(IFunction<? super Map.Entry<K,V>,? extends Map.Entry<X,Y>> function)
Description copied from interface: ExecutableMapEntryOperator

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

This function must be able to take as input an object of the current operator's target type, and will return an object of a different type but same structure, which will be from then on the new operator's target type.

Specified by:
execAsMapEntry in interface ExecutableMapEntryOperator<K,V>
Type Parameters:
X - the type of the resulting keys
Y - the type of the resulting values
Parameters:
function - the function to be executed
Returns:
an operator on the results of function execution

replaceWith

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

exec

<X> ILevel1ListElementsOperator<I,X> exec(IFunction<? super Map.Entry<K,V>,X> function)
Description copied from interface: ExecutableMapEntryOperator

Executes the specified function on the target map entry, creating a new generic operator containing the result of the execution and setting the new operator type to the one specified.

Specified by:
exec in interface ExecutableMapEntryOperator<K,V>
Type Parameters:
X - the type of the result object
Parameters:
function - the function to be executed
Returns:
an operator on the results of function execution

execIfTrueAsMapEntry

ILevel1MapEntriesOperator<I,K,V> execIfTrueAsMapEntry(IFunction<? super Map.Entry<K,V>,Boolean> eval,
                                                      IFunction<? super Map.Entry<K,V>,? extends Map.Entry<? extends K,? extends V>> function)
Description copied from interface: ExecutableMapEntryOperator

Executes a function in a way equivalent to ExecutableMapEntryOperator.execAsMapEntry(IFunction) but only on selected elements, leaving all other elements untouched.

Specified by:
execIfTrueAsMapEntry in interface ExecutableMapEntryOperator<K,V>
Parameters:
eval - the evaluation function used to select elements
function - the function to be executed on the selected elements
Returns:
an operator on the results of function execution

execIfFalseAsMapEntry

ILevel1MapEntriesOperator<I,K,V> execIfFalseAsMapEntry(IFunction<? super Map.Entry<K,V>,Boolean> eval,
                                                       IFunction<? super Map.Entry<K,V>,? extends Map.Entry<? extends K,? extends V>> function)
Description copied from interface: ExecutableMapEntryOperator

Executes a function in a way equivalent to ExecutableMapEntryOperator.execAsMapEntry(IFunction) but only on selected elements, leaving all other elements untouched.

Specified by:
execIfFalseAsMapEntry in interface ExecutableMapEntryOperator<K,V>
Parameters:
eval - the evaluation function used to select elements
function - the function to be executed on the selected elements
Returns:
an operator on the results of function execution

execIfTrueAsMapEntry

<X,Y> ILevel1MapEntriesOperator<I,X,Y> execIfTrueAsMapEntry(IFunction<? super Map.Entry<K,V>,Boolean> eval,
                                                            IFunction<? super Map.Entry<K,V>,? extends Map.Entry<X,Y>> function,
                                                            IFunction<? super Map.Entry<K,V>,? extends Map.Entry<X,Y>> elseFunction)
Description copied from interface: ExecutableMapEntryOperator

Executes a function in a way equivalent to ExecutableMapEntryOperator.execAsMapEntry(IFunction) but only on selected elements, leaving all other elements untouched.

Specified by:
execIfTrueAsMapEntry in interface ExecutableMapEntryOperator<K,V>
Type Parameters:
X - the new type of the keys returned by the functions
Y - the new type of the values returned by the functions
Parameters:
eval - the evaluation function used to select elements
function - the function to be executed on the selected elements
elseFunction - the function to be executed on the non-selected elements
Returns:
an operator on the results of function execution

execIfFalseAsMapEntry

<X,Y> ILevel1MapEntriesOperator<I,X,Y> execIfFalseAsMapEntry(IFunction<? super Map.Entry<K,V>,Boolean> eval,
                                                             IFunction<? super Map.Entry<K,V>,? extends Map.Entry<X,Y>> function,
                                                             IFunction<? super Map.Entry<K,V>,? extends Map.Entry<X,Y>> elseFunction)
Description copied from interface: ExecutableMapEntryOperator

Executes a function in a way equivalent to ExecutableMapEntryOperator.execAsMapEntry(IFunction) but only on selected elements, leaving all other elements untouched.

Specified by:
execIfFalseAsMapEntry in interface ExecutableMapEntryOperator<K,V>
Type Parameters:
X - the new type of the keys returned by the functions
Y - the new type of the values returned by the functions
Parameters:
eval - the evaluation function used to select elements
function - the function to be executed on the selected elements
elseFunction - the function to be executed on the non-selected elements
Returns:
an operator on the results of function execution


Copyright © 2012 The OP4J team. All Rights Reserved.