org.op4j.operators.impl.fn.map
Class Level0MapOperator<I,K,V>

Object
  extended by org.op4j.operators.impl.AbstractOperator
      extended by org.op4j.operators.impl.fn.map.Level0MapOperator<I,K,V>
All Implemented Interfaces:
ILevel0MapOperator<I,K,V>, CastableToMapOperator, ExecutableMapOperator<K,V>, ExtractableMapOperator<K,V>, GenerizableOperator<I,Map<K,V>>, ModifiableMapOperator<K,V>, NavigableMapOperator<K,V>, Operator, ReplaceableIfNullOperator<Map<K,V>>, ReplaceableOperator<Map<K,V>>, ReversibleOperator<Map.Entry<K,V>>, SelectableOperator<Map<K,V>>, SortableOperator<Map.Entry<K,V>>, TotalizableOperator<I,Map.Entry<K,V>>, UniqFnOperator<I,Map<K,V>>, UniqOperator<Map<K,V>>

public final class Level0MapOperator<I,K,V>
extends AbstractOperator
implements UniqFnOperator<I,Map<K,V>>, ILevel0MapOperator<I,K,V>

Since:
1.0
Author:
Daniel Fernández

Constructor Summary
Level0MapOperator(Target target)
           
 
Method Summary
 Level0GenericUniqOperator<I,Boolean> all(IFunction<? super Map.Entry<K,V>,Boolean> eval)
           
 Level0GenericUniqOperator<I,Boolean> any(IFunction<? super Map.Entry<K,V>,Boolean> eval)
           
<X,Y> Level0MapOperator<I,X,Y>
castToMapOf(org.javaruntype.type.Type<X> keyType, org.javaruntype.type.Type<Y> valueType)
           Casts the operator's target as a map of the specified types.
<X> Level0GenericUniqOperator<I,X>
exec(IFunction<? super Map<K,V>,X> function)
           Executes the specified function on the target object, creating a new generic operator containing the result of the execution and setting the new operator type to the one specified.
<X,Y> Level0MapOperator<I,X,Y>
execAsMap(IFunction<? super Map<K,V>,? extends Map<X,Y>> function)
           Executes the specified function on the target map, creating a new map operator containing the result of the execution.
 Level0MapOperator<I,K,V> execIfFalseAsMap(IFunction<? super Map<K,V>,Boolean> eval, IFunction<? super Map<K,V>,? extends Map<? extends K,? extends V>> function)
           Executes a function in a way equivalent to ExecutableMapOperator.execAsMap(IFunction) but only on selected elements, leaving all other elements untouched.
<X,Y> Level0MapOperator<I,X,Y>
execIfFalseAsMap(IFunction<? super Map<K,V>,Boolean> eval, IFunction<? super Map<K,V>,? extends Map<X,Y>> function, IFunction<? super Map<K,V>,? extends Map<X,Y>> elseFunction)
           Executes a function in a way equivalent to ExecutableMapOperator.execAsMap(IFunction) but only on selected elements, leaving all other elements untouched.
 Level0MapOperator<I,K,V> execIfNotNullAsMap(IFunction<? super Map<K,V>,? extends Map<? extends K,? extends V>> function)
           Executes a function in a way equivalent to ExecutableMapOperator.execAsMap(IFunction) but only on selected elements, leaving all other elements untouched.
<X,Y> Level0MapOperator<I,X,Y>
execIfNotNullAsMap(IFunction<? super Map<K,V>,? extends Map<X,Y>> function, IFunction<? super Map<K,V>,? extends Map<X,Y>> elseFunction)
           Executes a function in a way equivalent to ExecutableMapOperator.execAsMap(IFunction) but only on selected elements, leaving all other elements untouched.
 Level0MapOperator<I,K,V> execIfNullAsMap(IFunction<? super Map<K,V>,? extends Map<? extends K,? extends V>> function)
           Executes a function in a way equivalent to ExecutableMapOperator.execAsMap(IFunction) but only on selected elements, leaving all other elements untouched.
<X,Y> Level0MapOperator<I,X,Y>
execIfNullAsMap(IFunction<? super Map<K,V>,? extends Map<X,Y>> function, IFunction<? super Map<K,V>,? extends Map<X,Y>> elseFunction)
           Executes a function in a way equivalent to ExecutableMapOperator.execAsMap(IFunction) but only on selected elements, leaving all other elements untouched.
 Level0MapOperator<I,K,V> execIfTrueAsMap(IFunction<? super Map<K,V>,Boolean> eval, IFunction<? super Map<K,V>,? extends Map<? extends K,? extends V>> function)
           Executes a function in a way equivalent to ExecutableMapOperator.execAsMap(IFunction) but only on selected elements, leaving all other elements untouched.
<X,Y> Level0MapOperator<I,X,Y>
execIfTrueAsMap(IFunction<? super Map<K,V>,Boolean> eval, IFunction<? super Map<K,V>,? extends Map<X,Y>> function, IFunction<? super Map<K,V>,? extends Map<X,Y>> elseFunction)
           Executes a function in a way equivalent to ExecutableMapOperator.execAsMap(IFunction) but only on selected elements, leaving all other elements untouched.
 Level0SetOperator<I,K> extractKeys()
           Extracts only the keys of the map (discarding values) and creates an operator which will hold these keys as a target object of type Set.
 Level0ListOperator<I,V> extractValues()
           Extracts only the values of the map (discarding keys) and creates an operator which will hold these values as a target object of type List.
 Level1MapEntriesOperator<I,K,V> forEachEntry()
           Iterates the target map's entries.
 Level0GenericUniqOperator<I,Map<K,V>> generic()
           Converts the specialized structure operator into generic operators (with no specific methods for structures - e.g. forEach())
 Function<I,Map<K,V>> get()
           Returns a function which will execute all the logic specified from the "Fn.on" expression.
 Level0MapSelectedOperator<I,K,V> ifFalse(IFunction<? super Map<K,V>,Boolean> eval)
           Selects only those targets for which the specified evaluator returns false.
 Level0MapSelectedOperator<I,K,V> ifNotNull()
           Selects only those targets which are not null.
 Level0MapSelectedOperator<I,K,V> ifNull()
           Selects only those targets which are null.
 Level0MapSelectedOperator<I,K,V> ifTrue(IFunction<? super Map<K,V>,Boolean> eval)
           Selects only those targets for which the specified evaluator returns true.
 Level0MapOperator<I,K,V> insert(int position, K newKey, V newValue)
           Inserts a new entry with the specified key and value into the specified position (starting in 0) of the target map.
 Level0MapOperator<I,K,V> insertAll(int position, Map<K,V> map)
           Inserts all the entries in the specified map to the target map, in the specified position.
<X,Y> Level0MapOperator<I,X,Y>
of(org.javaruntype.type.Type<X> keyType, org.javaruntype.type.Type<Y> valueType)
           Casts the operator's target as a map of the specified types.
 Level0MapOperator<I,K,V> put(K newKey, V newValue)
           Adds a new entry with the specified key and value at the end of the target map.
 Level0MapOperator<I,K,V> putAll(Map<K,V> map)
           Adds all the entries in the specified map to the target map.
 Level0MapOperator<I,K,V> removeAllFalse(IFunction<? super Map.Entry<K,V>,Boolean> eval)
           Removes from the target map all the entries which evaluate as false using the specified evaluator.
 Level0MapOperator<I,K,V> removeAllKeys(K... keys)
           Removes from the target map all entries which keys match the ones specified.
 Level0MapOperator<I,K,V> removeAllKeysNot(K... keys)
           Removes from the target map all entries except those which keys match the ones specified.
 Level0MapOperator<I,K,V> removeAllTrue(IFunction<? super Map.Entry<K,V>,Boolean> eval)
           Removes from the target map all the entries which evaluate as true using the specified evaluator.
 Level0MapOperator<I,K,V> replaceIfNullWith(Map<K,V> replacement)
           Replaces the current target object with the specified replacement if the current target is null.
 Level0MapOperator<I,K,V> replaceWith(Map<K,V> replacement)
           Replaces the current target object with the specified replacement.
 Level0MapOperator<I,K,V> reverse()
           Reverses the elements of the structure.
 Level0MapOperator<I,K,V> sort()
           Sorts the elements of the structure according to their natural ordering.
 Level0MapOperator<I,K,V> sort(Comparator<? super Map.Entry<K,V>> comparator)
           Sorts the elements of the structure according to the order induced by the specified comparator.
 Level0MapOperator<I,K,V> sortBy(IFunction<? super Map.Entry<K,V>,?> by)
           Sorts the elements of the structure according to the result of executing the specified function.
 
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

Level0MapOperator

public Level0MapOperator(Target target)
Method Detail

extractKeys

public Level0SetOperator<I,K> extractKeys()
Description copied from interface: ExtractableMapOperator

Extracts only the keys of the map (discarding values) and creates an operator which will hold these keys as a target object of type Set.

Specified by:
extractKeys in interface ILevel0MapOperator<I,K,V>
Specified by:
extractKeys in interface ExtractableMapOperator<K,V>
Returns:
an operator with the set of keys as a target object

extractValues

public Level0ListOperator<I,V> extractValues()
Description copied from interface: ExtractableMapOperator

Extracts only the values of the map (discarding keys) and creates an operator which will hold these values as a target object of type List.

Specified by:
extractValues in interface ILevel0MapOperator<I,K,V>
Specified by:
extractValues in interface ExtractableMapOperator<K,V>
Returns:
an operator with the list of values as a target object

forEachEntry

public Level1MapEntriesOperator<I,K,V> forEachEntry()
Description copied from interface: NavigableMapOperator

Iterates the target map's entries. After executing this method, any further operations will be applied on each of the map entries (java.util.Map.Entry objects) until an "endFor()" method is called.

Specified by:
forEachEntry in interface ILevel0MapOperator<I,K,V>
Specified by:
forEachEntry in interface NavigableMapOperator<K,V>
Returns:
an operator which will execute all operations on each entry of the map.

put

public Level0MapOperator<I,K,V> put(K newKey,
                                    V newValue)
Description copied from interface: ModifiableMapOperator

Adds a new entry with the specified key and value at the end of the target map.

The original target object is not modified, but copied instead.

Specified by:
put in interface ILevel0MapOperator<I,K,V>
Specified by:
put in interface ModifiableMapOperator<K,V>
Parameters:
newKey - the key for the new entry to be added
newValue - the value for the new entry to be added
Returns:
an operator holding the modified map

insert

public Level0MapOperator<I,K,V> insert(int position,
                                       K newKey,
                                       V newValue)
Description copied from interface: ModifiableMapOperator

Inserts a new entry with the specified key and value into the specified position (starting in 0) of the target map.

The original target object is not modified, but copied instead.

Specified by:
insert in interface ILevel0MapOperator<I,K,V>
Specified by:
insert in interface ModifiableMapOperator<K,V>
Parameters:
position - the position into which the new entry will be inserted
newKey - the key for the new entry to be insert
newValue - the value for the new entry to be insert
Returns:
an operator holding the modified map

putAll

public Level0MapOperator<I,K,V> putAll(Map<K,V> map)
Description copied from interface: ModifiableMapOperator

Adds all the entries in the specified map to the target map.

The original target object is not modified, but copied instead.

Specified by:
putAll in interface ILevel0MapOperator<I,K,V>
Specified by:
putAll in interface ModifiableMapOperator<K,V>
Parameters:
map - the map containing the entries to be added.
Returns:
an operator holding the modified map

insertAll

public Level0MapOperator<I,K,V> insertAll(int position,
                                          Map<K,V> map)
Description copied from interface: ModifiableMapOperator

Inserts all the entries in the specified map to the target map, in the specified position.

The original target object is not modified, but copied instead.

Specified by:
insertAll in interface ILevel0MapOperator<I,K,V>
Specified by:
insertAll in interface ModifiableMapOperator<K,V>
Parameters:
position - the position into which the entries will be added.
map - the map containing the entries to be inserted.
Returns:
an operator holding the modified map

removeAllKeys

public Level0MapOperator<I,K,V> removeAllKeys(K... keys)
Description copied from interface: ModifiableMapOperator

Removes from the target map all entries which keys match the ones specified.

The original target object is not modified, but copied instead.

Specified by:
removeAllKeys in interface ILevel0MapOperator<I,K,V>
Specified by:
removeAllKeys in interface ModifiableMapOperator<K,V>
Parameters:
keys - the keys which have to be removed.
Returns:
an operator holding the modified map

removeAllTrue

public Level0MapOperator<I,K,V> removeAllTrue(IFunction<? super Map.Entry<K,V>,Boolean> eval)
Description copied from interface: ModifiableMapOperator

Removes from the target map all the entries which evaluate as true using the specified evaluator.

The original target object is not modified, but copied instead.

Specified by:
removeAllTrue in interface ILevel0MapOperator<I,K,V>
Specified by:
removeAllTrue in interface ModifiableMapOperator<K,V>
Parameters:
eval - the evaluator to be used, which must return Boolean
Returns:
an operator holding the modified map

removeAllFalse

public Level0MapOperator<I,K,V> removeAllFalse(IFunction<? super Map.Entry<K,V>,Boolean> eval)
Description copied from interface: ModifiableMapOperator

Removes from the target map all the entries which evaluate as false using the specified evaluator.

The original target object is not modified, but copied instead.

Specified by:
removeAllFalse in interface ILevel0MapOperator<I,K,V>
Specified by:
removeAllFalse in interface ModifiableMapOperator<K,V>
Parameters:
eval - the evaluator to be used, which must return Boolean
Returns:
an operator holding the modified map

removeAllKeysNot

public Level0MapOperator<I,K,V> removeAllKeysNot(K... keys)
Description copied from interface: ModifiableMapOperator

Removes from the target map all entries except those which keys match the ones specified.

The original target object is not modified, but copied instead.

Specified by:
removeAllKeysNot in interface ILevel0MapOperator<I,K,V>
Specified by:
removeAllKeysNot in interface ModifiableMapOperator<K,V>
Parameters:
keys - the keys which have to be kept.
Returns:
an operator holding the modified map

sort

public Level0MapOperator<I,K,V> sort()
Description copied from interface: SortableOperator

Sorts the elements of the structure according to their natural ordering.

Specified by:
sort in interface ILevel0MapOperator<I,K,V>
Specified by:
sort in interface SortableOperator<Map.Entry<K,V>>
Returns:
an operator containing the sorted structure as target object.

sort

public Level0MapOperator<I,K,V> sort(Comparator<? super Map.Entry<K,V>> comparator)
Description copied from interface: SortableOperator

Sorts the elements of the structure according to the order induced by the specified comparator.

Specified by:
sort in interface ILevel0MapOperator<I,K,V>
Specified by:
sort in interface SortableOperator<Map.Entry<K,V>>
Parameters:
comparator - the comparator to be used.
Returns:
an operator containing the sorted structure as target object.

get

public Function<I,Map<K,V>> get()
Description copied from interface: UniqFnOperator

Returns a function which will execute all the logic specified from the "Fn.on" expression.

Specified by:
get in interface UniqFnOperator<I,Map<K,V>>
Returns:
the function.

generic

public Level0GenericUniqOperator<I,Map<K,V>> generic()
Description copied from interface: GenerizableOperator

Converts the specialized structure operator into generic operators (with no specific methods for structures - e.g. forEach())

Specified by:
generic in interface ILevel0MapOperator<I,K,V>
Specified by:
generic in interface GenerizableOperator<I,Map<K,V>>
Returns:
a generic operator on the same target object

of

public <X,Y> Level0MapOperator<I,X,Y> of(org.javaruntype.type.Type<X> keyType,
                                         org.javaruntype.type.Type<Y> valueType)
Description copied from interface: CastableToMapOperator

Casts the operator's target as a map of the specified types.

Specified by:
of in interface ILevel0MapOperator<I,K,V>
Specified by:
of in interface CastableToMapOperator
Type Parameters:
X - the type for the map's keys
Y - the type for the map's values
Parameters:
keyType - the type for the map's keys
valueType - the type for the map's values
Returns:
the resulting map

castToMapOf

public <X,Y> Level0MapOperator<I,X,Y> castToMapOf(org.javaruntype.type.Type<X> keyType,
                                                  org.javaruntype.type.Type<Y> valueType)
Description copied from interface: CastableToMapOperator

Casts the operator's target as a map of the specified types.

Specified by:
castToMapOf in interface ILevel0MapOperator<I,K,V>
Specified by:
castToMapOf in interface CastableToMapOperator
Type Parameters:
X - the type for the map's keys
Y - the type for the map's values
Parameters:
keyType - the type for the map's keys
valueType - the type for the map's values
Returns:
the resulting map

ifTrue

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

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 ILevel0MapOperator<I,K,V>
Specified by:
ifTrue in interface SelectableOperator<Map<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

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

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 ILevel0MapOperator<I,K,V>
Specified by:
ifFalse in interface SelectableOperator<Map<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.

ifNotNull

public Level0MapSelectedOperator<I,K,V> ifNotNull()
Description copied from interface: SelectableOperator

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

ifNull

public Level0MapSelectedOperator<I,K,V> ifNull()
Description copied from interface: SelectableOperator

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

execAsMap

public <X,Y> Level0MapOperator<I,X,Y> execAsMap(IFunction<? super Map<K,V>,? extends Map<X,Y>> function)
Description copied from interface: ExecutableMapOperator

Executes the specified function on the target map, creating a new map 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:
execAsMap in interface ILevel0MapOperator<I,K,V>
Specified by:
execAsMap in interface ExecutableMapOperator<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

exec

public <X> Level0GenericUniqOperator<I,X> exec(IFunction<? super Map<K,V>,X> function)
Description copied from interface: ExecutableMapOperator

Executes the specified function on the target object, 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 ILevel0MapOperator<I,K,V>
Specified by:
exec in interface ExecutableMapOperator<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

replaceWith

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

Replaces the current target object with the specified replacement.

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

replaceIfNullWith

public Level0MapOperator<I,K,V> replaceIfNullWith(Map<K,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 ILevel0MapOperator<I,K,V>
Specified by:
replaceIfNullWith in interface ReplaceableIfNullOperator<Map<K,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.

all

public Level0GenericUniqOperator<I,Boolean> all(IFunction<? super Map.Entry<K,V>,Boolean> eval)
Specified by:
all in interface ILevel0MapOperator<I,K,V>
Specified by:
all in interface TotalizableOperator<I,Map.Entry<K,V>>

any

public Level0GenericUniqOperator<I,Boolean> any(IFunction<? super Map.Entry<K,V>,Boolean> eval)
Specified by:
any in interface ILevel0MapOperator<I,K,V>
Specified by:
any in interface TotalizableOperator<I,Map.Entry<K,V>>

sortBy

public Level0MapOperator<I,K,V> sortBy(IFunction<? super Map.Entry<K,V>,?> by)
Description copied from interface: SortableOperator

Sorts the elements of the structure according to the result of executing the specified function.

Specified by:
sortBy in interface ILevel0MapOperator<I,K,V>
Specified by:
sortBy in interface SortableOperator<Map.Entry<K,V>>
Parameters:
by - the function to be executed in order to obtain the compared object
Returns:
an operator containing the sorted structure as target object.

reverse

public Level0MapOperator<I,K,V> reverse()
Description copied from interface: ReversibleOperator

Reverses the elements of the structure.

Specified by:
reverse in interface ILevel0MapOperator<I,K,V>
Specified by:
reverse in interface ReversibleOperator<Map.Entry<K,V>>
Returns:
an operator containing the reversed structure as target object.

execIfFalseAsMap

public Level0MapOperator<I,K,V> execIfFalseAsMap(IFunction<? super Map<K,V>,Boolean> eval,
                                                 IFunction<? super Map<K,V>,? extends Map<? extends K,? extends V>> function)
Description copied from interface: ExecutableMapOperator

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

Specified by:
execIfFalseAsMap in interface ILevel0MapOperator<I,K,V>
Specified by:
execIfFalseAsMap in interface ExecutableMapOperator<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

execIfFalseAsMap

public <X,Y> Level0MapOperator<I,X,Y> execIfFalseAsMap(IFunction<? super Map<K,V>,Boolean> eval,
                                                       IFunction<? super Map<K,V>,? extends Map<X,Y>> function,
                                                       IFunction<? super Map<K,V>,? extends Map<X,Y>> elseFunction)
Description copied from interface: ExecutableMapOperator

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

Specified by:
execIfFalseAsMap in interface ILevel0MapOperator<I,K,V>
Specified by:
execIfFalseAsMap in interface ExecutableMapOperator<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

execIfNotNullAsMap

public Level0MapOperator<I,K,V> execIfNotNullAsMap(IFunction<? super Map<K,V>,? extends Map<? extends K,? extends V>> function)
Description copied from interface: ExecutableMapOperator

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

Specified by:
execIfNotNullAsMap in interface ILevel0MapOperator<I,K,V>
Specified by:
execIfNotNullAsMap in interface ExecutableMapOperator<K,V>
Parameters:
function - the function to be executed on the selected elements
Returns:
an operator on the results of function execution

execIfNotNullAsMap

public <X,Y> Level0MapOperator<I,X,Y> execIfNotNullAsMap(IFunction<? super Map<K,V>,? extends Map<X,Y>> function,
                                                         IFunction<? super Map<K,V>,? extends Map<X,Y>> elseFunction)
Description copied from interface: ExecutableMapOperator

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

Specified by:
execIfNotNullAsMap in interface ILevel0MapOperator<I,K,V>
Specified by:
execIfNotNullAsMap in interface ExecutableMapOperator<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:
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

execIfNullAsMap

public Level0MapOperator<I,K,V> execIfNullAsMap(IFunction<? super Map<K,V>,? extends Map<? extends K,? extends V>> function)
Description copied from interface: ExecutableMapOperator

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

Specified by:
execIfNullAsMap in interface ILevel0MapOperator<I,K,V>
Specified by:
execIfNullAsMap in interface ExecutableMapOperator<K,V>
Parameters:
function - the function to be executed on the selected elements
Returns:
an operator on the results of function execution

execIfNullAsMap

public <X,Y> Level0MapOperator<I,X,Y> execIfNullAsMap(IFunction<? super Map<K,V>,? extends Map<X,Y>> function,
                                                      IFunction<? super Map<K,V>,? extends Map<X,Y>> elseFunction)
Description copied from interface: ExecutableMapOperator

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

Specified by:
execIfNullAsMap in interface ILevel0MapOperator<I,K,V>
Specified by:
execIfNullAsMap in interface ExecutableMapOperator<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:
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

execIfTrueAsMap

public Level0MapOperator<I,K,V> execIfTrueAsMap(IFunction<? super Map<K,V>,Boolean> eval,
                                                IFunction<? super Map<K,V>,? extends Map<? extends K,? extends V>> function)
Description copied from interface: ExecutableMapOperator

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

Specified by:
execIfTrueAsMap in interface ILevel0MapOperator<I,K,V>
Specified by:
execIfTrueAsMap in interface ExecutableMapOperator<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

execIfTrueAsMap

public <X,Y> Level0MapOperator<I,X,Y> execIfTrueAsMap(IFunction<? super Map<K,V>,Boolean> eval,
                                                      IFunction<? super Map<K,V>,? extends Map<X,Y>> function,
                                                      IFunction<? super Map<K,V>,? extends Map<X,Y>> elseFunction)
Description copied from interface: ExecutableMapOperator

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

Specified by:
execIfTrueAsMap in interface ILevel0MapOperator<I,K,V>
Specified by:
execIfTrueAsMap in interface ExecutableMapOperator<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.