|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object org.op4j.operators.impl.AbstractOperator org.op4j.operators.impl.op.map.Level1MapEntriesOperator<I,K,V>
public final class Level1MapEntriesOperator<I,K,V>
Constructor Summary | |
---|---|
Level1MapEntriesOperator(Target target)
|
Method Summary | ||
---|---|---|
Level0MapOperator<I,K,V> |
endFor()
Ends the current iteration. |
|
|
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. |
|
|
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. |
|
Level1MapEntriesOperator<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. |
|
|
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. |
|
Level1MapEntriesOperator<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. |
|
|
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. |
|
Map<K,V> |
get()
Returns the target object this operator currently holds. |
|
Level1MapEntriesSelectedOperator<I,K,V> |
ifFalse(IFunction<? super Map.Entry<K,V>,Boolean> eval)
Selects only those targets for which the specified evaluator returns false. |
|
Level1MapEntriesSelectedOperator<I,K,V> |
ifIndex(int... indexes)
Selects only those targets which index in the current level of iteration matches any of the specified indexes. |
|
Level1MapEntriesSelectedOperator<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. |
|
Level1MapEntriesSelectedOperator<I,K,V> |
ifKeyEquals(K... keys)
Selects only those entries which key matches any of the specified values. |
|
Level1MapEntriesSelectedOperator<I,K,V> |
ifKeyNotEquals(K... keys)
Selects only those entries which key does not match any of the specified values. |
|
Level1MapEntriesSelectedOperator<I,K,V> |
ifTrue(IFunction<? super Map.Entry<K,V>,Boolean> eval)
Selects only those targets for which the specified evaluator returns true. |
|
Level2MapEntriesKeyOperator<I,K,V> |
onKey()
Accesses the key of a map entry. |
|
Level2MapEntriesValueOperator<I,K,V> |
onValue()
Accesses the value of a map entry. |
|
Level1MapEntriesOperator<I,K,V> |
replaceWith(Map.Entry<K,V> replacement)
Replaces the current target object with the specified replacement. |
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 |
---|
public Level1MapEntriesOperator(Target target)
Method Detail |
---|
public Level0MapOperator<I,K,V> endFor()
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.
endFor
in interface ILevel1MapEntriesOperator<I,K,V>
endFor
in interface NavigatingMapOperator<K,V>
public Level2MapEntriesKeyOperator<I,K,V> onKey()
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.
onKey
in interface ILevel1MapEntriesOperator<I,K,V>
onKey
in interface NavigableMapEntryOperator
public Level2MapEntriesValueOperator<I,K,V> onValue()
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.
onValue
in interface ILevel1MapEntriesOperator<I,K,V>
onValue
in interface NavigableMapEntryOperator
public Map<K,V> get()
UniqOpOperator
Returns the target object this operator currently holds.
get
in interface UniqOpOperator<I,Map<K,V>>
public Level1MapEntriesSelectedOperator<I,K,V> ifIndex(int... indexes)
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.
ifIndex
in interface ILevel1MapEntriesOperator<I,K,V>
ifIndex
in interface SelectableMapEntryOperator<K,V>
indexes
- the indexes of the target objects which will be selected.
public Level1MapEntriesSelectedOperator<I,K,V> ifIndexNot(int... indexes)
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.
ifIndexNot
in interface ILevel1MapEntriesOperator<I,K,V>
ifIndexNot
in interface SelectableMapEntryOperator<K,V>
indexes
- the indexes of the target objects which will be selected.
public Level1MapEntriesSelectedOperator<I,K,V> ifKeyEquals(K... keys)
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.
ifKeyEquals
in interface ILevel1MapEntriesOperator<I,K,V>
ifKeyEquals
in interface SelectableMapEntryOperator<K,V>
keys
- the key values to be matched
public Level1MapEntriesSelectedOperator<I,K,V> ifKeyNotEquals(K... keys)
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.
ifKeyNotEquals
in interface ILevel1MapEntriesOperator<I,K,V>
ifKeyNotEquals
in interface SelectableMapEntryOperator<K,V>
keys
- the key values to be matched
public Level1MapEntriesSelectedOperator<I,K,V> ifTrue(IFunction<? super Map.Entry<K,V>,Boolean> eval)
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.
ifTrue
in interface ILevel1MapEntriesOperator<I,K,V>
ifTrue
in interface SelectableMapEntryOperator<K,V>
eval
- the evaluator to be used for selecting targets.
public Level1MapEntriesSelectedOperator<I,K,V> ifFalse(IFunction<? super Map.Entry<K,V>,Boolean> eval)
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.
ifFalse
in interface ILevel1MapEntriesOperator<I,K,V>
ifFalse
in interface SelectableMapEntryOperator<K,V>
eval
- the evaluator to be used for selecting targets.
public <X,Y> Level1MapEntriesOperator<I,X,Y> execAsMapEntry(IFunction<? super Map.Entry<K,V>,? extends Map.Entry<X,Y>> function)
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.
execAsMapEntry
in interface ILevel1MapEntriesOperator<I,K,V>
execAsMapEntry
in interface ExecutableMapEntryOperator<K,V>
X
- the type of the resulting keysY
- the type of the resulting valuesfunction
- the function to be executed
public <X> Level1ListElementsOperator<I,X> exec(IFunction<? super Map.Entry<K,V>,X> function)
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.
exec
in interface ILevel1MapEntriesOperator<I,K,V>
exec
in interface ExecutableMapEntryOperator<K,V>
X
- the type of the result objectfunction
- the function to be executed
public Level1MapEntriesOperator<I,K,V> replaceWith(Map.Entry<K,V> replacement)
ReplaceableOperator
Replaces the current target object with the specified replacement.
replaceWith
in interface ILevel1MapEntriesOperator<I,K,V>
replaceWith
in interface ReplaceableOperator<Map.Entry<K,V>>
replacement
- the object which will replace the current target object.
public Level1MapEntriesOperator<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)
ExecutableMapEntryOperator
Executes a function in a way equivalent to ExecutableMapEntryOperator.execAsMapEntry(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfFalseAsMapEntry
in interface ILevel1MapEntriesOperator<I,K,V>
execIfFalseAsMapEntry
in interface ExecutableMapEntryOperator<K,V>
eval
- the evaluation function used to select elementsfunction
- the function to be executed on the selected elements
public <X,Y> Level1MapEntriesOperator<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)
ExecutableMapEntryOperator
Executes a function in a way equivalent to ExecutableMapEntryOperator.execAsMapEntry(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfFalseAsMapEntry
in interface ILevel1MapEntriesOperator<I,K,V>
execIfFalseAsMapEntry
in interface ExecutableMapEntryOperator<K,V>
X
- the new type of the keys returned by the functionsY
- the new type of the values returned by the functionseval
- the evaluation function used to select elementsfunction
- the function to be executed on the selected elementselseFunction
- the function to be executed on the non-selected elements
public Level1MapEntriesOperator<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)
ExecutableMapEntryOperator
Executes a function in a way equivalent to ExecutableMapEntryOperator.execAsMapEntry(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfTrueAsMapEntry
in interface ILevel1MapEntriesOperator<I,K,V>
execIfTrueAsMapEntry
in interface ExecutableMapEntryOperator<K,V>
eval
- the evaluation function used to select elementsfunction
- the function to be executed on the selected elements
public <X,Y> Level1MapEntriesOperator<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)
ExecutableMapEntryOperator
Executes a function in a way equivalent to ExecutableMapEntryOperator.execAsMapEntry(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfTrueAsMapEntry
in interface ILevel1MapEntriesOperator<I,K,V>
execIfTrueAsMapEntry
in interface ExecutableMapEntryOperator<K,V>
X
- the new type of the keys returned by the functionsY
- the new type of the values returned by the functionseval
- the evaluation function used to select elementsfunction
- the function to be executed on the selected elementselseFunction
- the function to be executed on the non-selected elements
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |