|
||||||||||
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.Level0MapSelectedOperator<I,K,V>
public final class Level0MapSelectedOperator<I,K,V>
Constructor Summary | |
---|---|
Level0MapSelectedOperator(Target target)
|
Method Summary | |
---|---|
Level0MapOperator<I,K,V> |
endIf()
Ends the selection currently active for this level. |
Level0MapSelectedOperator<I,K,V> |
execAsMap(IFunction<? super Map<K,V>,? extends Map<? extends K,? extends V>> function)
Executes the specified function on the target object, creating a new map operator containing the result of the execution. |
Level1MapSelectedEntriesOperator<I,K,V> |
forEachEntry()
Iterates the target map's entries. |
Map<K,V> |
get()
Returns the target object this operator currently holds. |
Level0MapSelectedOperator<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. |
Level0MapSelectedOperator<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. |
Level0MapSelectedOperator<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. |
Level0MapSelectedOperator<I,K,V> |
putAll(Map<K,V> map)
Adds all the entries in the specified map to the target map. |
Level0MapSelectedOperator<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. |
Level0MapSelectedOperator<I,K,V> |
removeAllKeys(K... keys)
Removes from the target map all entries which keys match the ones specified. |
Level0MapSelectedOperator<I,K,V> |
removeAllKeysNot(K... keys)
Removes from the target map all entries except those which keys match the ones specified. |
Level0MapSelectedOperator<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. |
Level0MapSelectedOperator<I,K,V> |
replaceWith(Map<K,V> replacement)
Replaces the current target object with the specified replacement. |
Level0MapSelectedOperator<I,K,V> |
sort()
Sorts the elements of the structure according to their natural ordering. |
Level0MapSelectedOperator<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. |
Level0MapSelectedOperator<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 |
---|
public Level0MapSelectedOperator(Target target)
Method Detail |
---|
public Level0MapSelectedOperator<I,K,V> sortBy(IFunction<? super Map.Entry<K,V>,?> by)
SortableOperator
Sorts the elements of the structure according to the result of executing the specified function.
sortBy
in interface ILevel0MapSelectedOperator<I,K,V>
sortBy
in interface SortableOperator<Map.Entry<K,V>>
by
- the function to be executed in order to obtain the compared object
public Level0MapSelectedOperator<I,K,V> insertAll(int position, Map<K,V> map)
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.
insertAll
in interface ILevel0MapSelectedOperator<I,K,V>
insertAll
in interface ModifiableMapOperator<K,V>
position
- the position into which the entries will be added.map
- the map containing the entries to be inserted.
public Level0MapSelectedOperator<I,K,V> removeAllTrue(IFunction<? super Map.Entry<K,V>,Boolean> eval)
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.
removeAllTrue
in interface ILevel0MapSelectedOperator<I,K,V>
removeAllTrue
in interface ModifiableMapOperator<K,V>
eval
- the evaluator to be used, which must return Boolean
public Level0MapSelectedOperator<I,K,V> removeAllFalse(IFunction<? super Map.Entry<K,V>,Boolean> eval)
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.
removeAllFalse
in interface ILevel0MapSelectedOperator<I,K,V>
removeAllFalse
in interface ModifiableMapOperator<K,V>
eval
- the evaluator to be used, which must return Boolean
public Level0MapOperator<I,K,V> endIf()
SelectedOperator
Ends the selection currently active for this level.
endIf
in interface ILevel0MapSelectedOperator<I,K,V>
endIf
in interface SelectedOperator<Map<K,V>>
public Level1MapSelectedEntriesOperator<I,K,V> forEachEntry()
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.
forEachEntry
in interface ILevel0MapSelectedOperator<I,K,V>
forEachEntry
in interface NavigableMapOperator<K,V>
public Level0MapSelectedOperator<I,K,V> removeAllKeys(K... keys)
ModifiableMapOperator
Removes from the target map all entries which keys match the ones specified.
The original target object is not modified, but copied instead.
removeAllKeys
in interface ILevel0MapSelectedOperator<I,K,V>
removeAllKeys
in interface ModifiableMapOperator<K,V>
keys
- the keys which have to be removed.
public Level0MapSelectedOperator<I,K,V> removeAllKeysNot(K... keys)
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.
removeAllKeysNot
in interface ILevel0MapSelectedOperator<I,K,V>
removeAllKeysNot
in interface ModifiableMapOperator<K,V>
keys
- the keys which have to be kept.
public Level0MapSelectedOperator<I,K,V> execAsMap(IFunction<? super Map<K,V>,? extends Map<? extends K,? extends V>> function)
ExecutableMapSelectedOperator
Executes the specified function on the target object, creating a new map 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).
execAsMap
in interface ILevel0MapSelectedOperator<I,K,V>
execAsMap
in interface ExecutableMapSelectedOperator<K,V>
function
- the function to be executed
public Level0MapSelectedOperator<I,K,V> put(K newKey, V newValue)
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.
put
in interface ILevel0MapSelectedOperator<I,K,V>
put
in interface ModifiableMapOperator<K,V>
newKey
- the key for the new entry to be addednewValue
- the value for the new entry to be added
public Level0MapSelectedOperator<I,K,V> putAll(Map<K,V> map)
ModifiableMapOperator
Adds all the entries in the specified map to the target map.
The original target object is not modified, but copied instead.
putAll
in interface ILevel0MapSelectedOperator<I,K,V>
putAll
in interface ModifiableMapOperator<K,V>
map
- the map containing the entries to be added.
public Level0MapSelectedOperator<I,K,V> insert(int position, K newKey, V newValue)
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.
insert
in interface ILevel0MapSelectedOperator<I,K,V>
insert
in interface ModifiableMapOperator<K,V>
position
- the position into which the new entry will be insertednewKey
- the key for the new entry to be insertnewValue
- the value for the new entry to be insert
public Level0MapSelectedOperator<I,K,V> sort()
SortableOperator
Sorts the elements of the structure according to their natural ordering.
sort
in interface ILevel0MapSelectedOperator<I,K,V>
sort
in interface SortableOperator<Map.Entry<K,V>>
public Level0MapSelectedOperator<I,K,V> sort(Comparator<? super Map.Entry<K,V>> comparator)
SortableOperator
Sorts the elements of the structure according to the order induced by the specified comparator.
sort
in interface ILevel0MapSelectedOperator<I,K,V>
sort
in interface SortableOperator<Map.Entry<K,V>>
comparator
- the comparator to be used.
public Level0MapSelectedOperator<I,K,V> replaceWith(Map<K,V> replacement)
ReplaceableOperator
Replaces the current target object with the specified replacement.
replaceWith
in interface ILevel0MapSelectedOperator<I,K,V>
replaceWith
in interface ReplaceableOperator<Map<K,V>>
replacement
- the object which will replace the current target object.
public Map<K,V> get()
UniqOpOperator
Returns the target object this operator currently holds.
get
in interface UniqOpOperator<I,Map<K,V>>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |