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

All Superinterfaces:
CastableToTypeOperator<V>, ExecutableOperator<V>, NavigatingMapEntryOperator, Operator, ReplaceableIfNullOperator<V>, ReplaceableOperator<V>, SelectableMapEntryComponentOperator<V>, UniqOperator<Map<K,V>>
All Known Implementing Classes:
Level2MapEntriesValueOperator, Level2MapEntriesValueOperator

public interface ILevel2MapEntriesValueOperator<I,K,V>
extends UniqOperator<Map<K,V>>, NavigatingMapEntryOperator, ExecutableOperator<V>, SelectableMapEntryComponentOperator<V>, ReplaceableOperator<V>, ReplaceableIfNullOperator<V>, CastableToTypeOperator<V>

Since:
1.0
Author:
Daniel Fernández

Method Summary
<X> ILevel2MapEntriesValueOperator<I,K,X>
castTo(org.javaruntype.type.Type<X> type)
           Casts the operator's target as the specified type.
 ILevel1MapEntriesOperator<I,K,V> endOn()
           Stops the selection of key/value.
<X> ILevel2MapEntriesValueOperator<I,K,X>
exec(IFunction<? super V,X> function)
           Executes the specified function on the target object, creating a new operator containing the result of the execution.
 ILevel2MapEntriesValueOperator<I,K,V> execIfFalse(IFunction<? super V,Boolean> eval, IFunction<? super V,? extends V> function)
           Executes a function in a way equivalent to ExecutableOperator.exec(IFunction) but only on selected elements, leaving all other elements untouched.
<X> ILevel2MapEntriesValueOperator<I,K,X>
execIfFalse(IFunction<? super V,Boolean> eval, IFunction<? super V,X> function, IFunction<? super V,X> elseFunction)
           Executes a function in a way equivalent to ExecutableOperator.exec(IFunction) but only on selected elements, leaving all other elements untouched.
 ILevel2MapEntriesValueOperator<I,K,V> execIfNotNull(IFunction<? super V,? extends V> function)
           Executes a function in a way equivalent to ExecutableOperator.exec(IFunction) but only on selected elements, leaving all other elements untouched.
<X> ILevel2MapEntriesValueOperator<I,K,X>
execIfNotNull(IFunction<? super V,X> function, IFunction<? super V,X> elseFunction)
           Executes a function in a way equivalent to ExecutableOperator.exec(IFunction) but only on selected elements, leaving all other elements untouched.
 ILevel2MapEntriesValueOperator<I,K,V> execIfNull(IFunction<? super V,? extends V> function)
           Executes a function in a way equivalent to ExecutableOperator.exec(IFunction) but only on selected elements, leaving all other elements untouched.
<X> ILevel2MapEntriesValueOperator<I,K,X>
execIfNull(IFunction<? super V,X> function, IFunction<? super V,X> elseFunction)
           Executes a function in a way equivalent to ExecutableOperator.exec(IFunction) but only on selected elements, leaving all other elements untouched.
 ILevel2MapEntriesValueOperator<I,K,V> execIfTrue(IFunction<? super V,Boolean> eval, IFunction<? super V,? extends V> function)
           Executes a function in a way equivalent to ExecutableOperator.exec(IFunction) but only on selected elements, leaving all other elements untouched.
<X> ILevel2MapEntriesValueOperator<I,K,X>
execIfTrue(IFunction<? super V,Boolean> eval, IFunction<? super V,X> function, IFunction<? super V,X> elseFunction)
           Executes a function in a way equivalent to ExecutableOperator.exec(IFunction) but only on selected elements, leaving all other elements untouched.
 ILevel2MapEntriesValueSelectedOperator<I,K,V> ifFalse(IFunction<? super V,Boolean> eval)
           Selects only those targets for which the specified evaluator returns false.
 ILevel2MapEntriesValueSelectedOperator<I,K,V> ifNotNull()
           Selects only those targets which are not null.
 ILevel2MapEntriesValueSelectedOperator<I,K,V> ifNull()
           Selects only those targets which are null.
 ILevel2MapEntriesValueSelectedOperator<I,K,V> ifTrue(IFunction<? super V,Boolean> eval)
           Selects only those targets for which the specified evaluator returns true.
 ILevel2MapEntriesValueOperator<I,K,V> replaceIfNullWith(V replacement)
           Replaces the current target object with the specified replacement if the current target is null.
 ILevel2MapEntriesValueOperator<I,K,V> replaceWith(V replacement)
           Replaces the current target object with the specified replacement.
 

Method Detail

ifTrue

ILevel2MapEntriesValueSelectedOperator<I,K,V> ifTrue(IFunction<? super V,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 SelectableMapEntryComponentOperator<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

ILevel2MapEntriesValueSelectedOperator<I,K,V> ifFalse(IFunction<? super V,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 SelectableMapEntryComponentOperator<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.

ifNull

ILevel2MapEntriesValueSelectedOperator<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 SelectableMapEntryComponentOperator<V>
Returns:
an operator which will execute all subsequent operations only on the selected target objects.

ifNotNull

ILevel2MapEntriesValueSelectedOperator<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 SelectableMapEntryComponentOperator<V>
Returns:
an operator which will execute all subsequent operations only on the selected target objects.

endOn

ILevel1MapEntriesOperator<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 NavigatingMapEntryOperator
Returns:
an operator which will execute all operations on the map entry as a whole.

replaceWith

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

Replaces the current target object with the specified replacement.

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

replaceIfNullWith

ILevel2MapEntriesValueOperator<I,K,V> replaceIfNullWith(V replacement)
Description copied from interface: ReplaceableIfNullOperator

Replaces the current target object with the specified replacement if the current target is null.

Specified by:
replaceIfNullWith in interface ReplaceableIfNullOperator<V>
Parameters:
replacement - the object which will replace the current target object if target is null.
Returns:
an operator containing the original target object if it was not null, or the new one if null.

exec

<X> ILevel2MapEntriesValueOperator<I,K,X> exec(IFunction<? super V,X> function)
Description copied from interface: ExecutableOperator

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

This function must be able to take as input an object of type T (the current operator's target type) and will return an object of type X, which will be from then on the new operator's target type.

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

execIfNotNull

ILevel2MapEntriesValueOperator<I,K,V> execIfNotNull(IFunction<? super V,? extends V> function)
Description copied from interface: ExecutableOperator

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

Specified by:
execIfNotNull in interface ExecutableOperator<V>
Parameters:
function - the function to be executed on the selected elements
Returns:
an operator on the results of function execution

execIfNull

ILevel2MapEntriesValueOperator<I,K,V> execIfNull(IFunction<? super V,? extends V> function)
Description copied from interface: ExecutableOperator

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

Specified by:
execIfNull in interface ExecutableOperator<V>
Parameters:
function - the function to be executed on the selected elements
Returns:
an operator on the results of function execution

execIfTrue

ILevel2MapEntriesValueOperator<I,K,V> execIfTrue(IFunction<? super V,Boolean> eval,
                                                 IFunction<? super V,? extends V> function)
Description copied from interface: ExecutableOperator

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

Specified by:
execIfTrue in interface ExecutableOperator<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

execIfFalse

ILevel2MapEntriesValueOperator<I,K,V> execIfFalse(IFunction<? super V,Boolean> eval,
                                                  IFunction<? super V,? extends V> function)
Description copied from interface: ExecutableOperator

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

Specified by:
execIfFalse in interface ExecutableOperator<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

execIfNotNull

<X> ILevel2MapEntriesValueOperator<I,K,X> execIfNotNull(IFunction<? super V,X> function,
                                                        IFunction<? super V,X> elseFunction)
Description copied from interface: ExecutableOperator

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

Specified by:
execIfNotNull in interface ExecutableOperator<V>
Type Parameters:
X - the new type returned by the functions
Parameters:
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

execIfNull

<X> ILevel2MapEntriesValueOperator<I,K,X> execIfNull(IFunction<? super V,X> function,
                                                     IFunction<? super V,X> elseFunction)
Description copied from interface: ExecutableOperator

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

Specified by:
execIfNull in interface ExecutableOperator<V>
Type Parameters:
X - the new type returned by the functions
Parameters:
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

execIfTrue

<X> ILevel2MapEntriesValueOperator<I,K,X> execIfTrue(IFunction<? super V,Boolean> eval,
                                                     IFunction<? super V,X> function,
                                                     IFunction<? super V,X> elseFunction)
Description copied from interface: ExecutableOperator

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

Specified by:
execIfTrue in interface ExecutableOperator<V>
Type Parameters:
X - the new type 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

execIfFalse

<X> ILevel2MapEntriesValueOperator<I,K,X> execIfFalse(IFunction<? super V,Boolean> eval,
                                                      IFunction<? super V,X> function,
                                                      IFunction<? super V,X> elseFunction)
Description copied from interface: ExecutableOperator

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

Specified by:
execIfFalse in interface ExecutableOperator<V>
Type Parameters:
X - the new type 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

castTo

<X> ILevel2MapEntriesValueOperator<I,K,X> castTo(org.javaruntype.type.Type<X> type)
Description copied from interface: CastableToTypeOperator

Casts the operator's target as the specified type.

Specified by:
castTo in interface CastableToTypeOperator<V>
Type Parameters:
X - the type of the targets
Parameters:
type - the type of targets
Returns:
the resulting casted operator


Copyright © 2012 The OP4J team. All Rights Reserved.