|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ILevel0BuildingMapOperator<I,K,V>
Method Summary | ||
---|---|---|
ILevel0GenericUniqOperator<I,Boolean> |
all(IFunction<? super Map.Entry<K,V>,Boolean> eval)
|
|
ILevel0BuildingMapOperator<I,K,V> |
and(K key,
V value)
Adds a new entry to the map being built. |
|
ILevel0GenericUniqOperator<I,Boolean> |
any(IFunction<? super Map.Entry<K,V>,Boolean> eval)
|
|
|
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. |
|
|
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. |
|
|
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. |
|
ILevel0MapOperator<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. |
|
|
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. |
|
ILevel0MapOperator<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. |
|
|
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. |
|
ILevel0MapOperator<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. |
|
|
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. |
|
ILevel0MapOperator<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. |
|
|
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. |
|
ILevel0SetOperator<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. |
|
ILevel0ListOperator<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. |
|
ILevel1MapEntriesOperator<I,K,V> |
forEachEntry()
Iterates the target map's entries. |
|
ILevel0GenericUniqOperator<I,Map<K,V>> |
generic()
Converts the specialized structure operator into generic operators (with no specific methods for structures - e.g. forEach()) |
|
ILevel0MapSelectedOperator<I,K,V> |
ifFalse(IFunction<? super Map<K,V>,Boolean> eval)
Selects only those targets for which the specified evaluator returns false. |
|
ILevel0MapSelectedOperator<I,K,V> |
ifNotNull()
Selects only those targets which are not null. |
|
ILevel0MapSelectedOperator<I,K,V> |
ifNull()
Selects only those targets which are null. |
|
ILevel0MapSelectedOperator<I,K,V> |
ifTrue(IFunction<? super Map<K,V>,Boolean> eval)
Selects only those targets for which the specified evaluator returns true. |
|
ILevel0MapOperator<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. |
|
ILevel0MapOperator<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. |
|
|
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. |
|
ILevel0MapOperator<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. |
|
ILevel0MapOperator<I,K,V> |
putAll(Map<K,V> map)
Adds all the entries in the specified map to the target map. |
|
ILevel0MapOperator<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. |
|
ILevel0MapOperator<I,K,V> |
removeAllKeys(K... keys)
Removes from the target map all entries which keys match the ones specified. |
|
ILevel0MapOperator<I,K,V> |
removeAllKeysNot(K... keys)
Removes from the target map all entries except those which keys match the ones specified. |
|
ILevel0MapOperator<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. |
|
ILevel0MapOperator<I,K,V> |
replaceIfNullWith(Map<K,V> replacement)
Replaces the current target object with the specified replacement if the current target is null. |
|
ILevel0MapOperator<I,K,V> |
replaceWith(Map<K,V> replacement)
Replaces the current target object with the specified replacement. |
|
ILevel0MapOperator<I,K,V> |
reverse()
Reverses the elements of the structure. |
|
ILevel0MapOperator<I,K,V> |
sort()
Sorts the elements of the structure according to their natural ordering. |
|
ILevel0MapOperator<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. |
|
ILevel0MapOperator<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. |
Method Detail |
---|
ILevel0BuildingMapOperator<I,K,V> and(K key, V value)
BuildingMapOperator
Adds a new entry to the map being built.
and
in interface BuildingMapOperator<I,K,V>
key
- the key to be addedvalue
- the value to be added
ILevel0MapSelectedOperator<I,K,V> ifTrue(IFunction<? super Map<K,V>,Boolean> eval)
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.
ifTrue
in interface SelectableOperator<Map<K,V>>
eval
- the evaluator to be used for selecting targets.
ILevel0MapSelectedOperator<I,K,V> ifFalse(IFunction<? super Map<K,V>,Boolean> eval)
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.
ifFalse
in interface SelectableOperator<Map<K,V>>
eval
- the evaluator to be used for selecting targets.
ILevel0MapSelectedOperator<I,K,V> ifNull()
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.
ifNull
in interface SelectableOperator<Map<K,V>>
ILevel0MapSelectedOperator<I,K,V> ifNotNull()
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.
ifNotNull
in interface SelectableOperator<Map<K,V>>
ILevel1MapEntriesOperator<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 NavigableMapOperator<K,V>
ILevel0MapOperator<I,K,V> sort()
SortableOperator
Sorts the elements of the structure according to their natural ordering.
sort
in interface SortableOperator<Map.Entry<K,V>>
ILevel0MapOperator<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 SortableOperator<Map.Entry<K,V>>
comparator
- the comparator to be used.
ILevel0MapOperator<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 SortableOperator<Map.Entry<K,V>>
by
- the function to be executed in order to obtain the compared object
ILevel0MapOperator<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 ModifiableMapOperator<K,V>
newKey
- the key for the new entry to be addednewValue
- the value for the new entry to be added
ILevel0MapOperator<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 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
ILevel0MapOperator<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 ModifiableMapOperator<K,V>
map
- the map containing the entries to be added.
ILevel0MapOperator<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 ModifiableMapOperator<K,V>
position
- the position into which the entries will be added.map
- the map containing the entries to be inserted.
ILevel0MapOperator<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 ModifiableMapOperator<K,V>
keys
- the keys which have to be removed.
ILevel0MapOperator<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 ModifiableMapOperator<K,V>
eval
- the evaluator to be used, which must return Boolean
ILevel0MapOperator<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 ModifiableMapOperator<K,V>
eval
- the evaluator to be used, which must return Boolean
ILevel0MapOperator<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 ModifiableMapOperator<K,V>
keys
- the keys which have to be kept.
ILevel0SetOperator<I,K> extractKeys()
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.
extractKeys
in interface ExtractableMapOperator<K,V>
ILevel0ListOperator<I,V> extractValues()
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.
extractValues
in interface ExtractableMapOperator<K,V>
ILevel0GenericUniqOperator<I,Map<K,V>> generic()
GenerizableOperator
Converts the specialized structure operator into generic operators (with no specific methods for structures - e.g. forEach())
generic
in interface GenerizableOperator<I,Map<K,V>>
ILevel0MapOperator<I,K,V> replaceWith(Map<K,V> replacement)
ReplaceableOperator
Replaces the current target object with the specified replacement.
replaceWith
in interface ReplaceableOperator<Map<K,V>>
replacement
- the object which will replace the current target object.
ILevel0MapOperator<I,K,V> replaceIfNullWith(Map<K,V> replacement)
ReplaceableIfNullOperator
Replaces the current target object with the specified replacement if the current target is null.
replaceIfNullWith
in interface ReplaceableIfNullOperator<Map<K,V>>
replacement
- the object which will replace the current target object if target is null.
<X> ILevel0GenericUniqOperator<I,X> exec(IFunction<? super Map<K,V>,X> function)
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.
exec
in interface ExecutableMapOperator<K,V>
X
- the type of the result objectfunction
- the function to be executed
<X,Y> ILevel0MapOperator<I,X,Y> execAsMap(IFunction<? super Map<K,V>,? extends Map<X,Y>> function)
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.
execAsMap
in interface ExecutableMapOperator<K,V>
X
- the type of the resulting keysY
- the type of the resulting valuesfunction
- the function to be executed
ILevel0MapOperator<I,K,V> execIfNotNullAsMap(IFunction<? super Map<K,V>,? extends Map<? extends K,? extends V>> function)
ExecutableMapOperator
Executes a function in a way equivalent to ExecutableMapOperator.execAsMap(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfNotNullAsMap
in interface ExecutableMapOperator<K,V>
function
- the function to be executed on the selected elements
ILevel0MapOperator<I,K,V> execIfNullAsMap(IFunction<? super Map<K,V>,? extends Map<? extends K,? extends V>> function)
ExecutableMapOperator
Executes a function in a way equivalent to ExecutableMapOperator.execAsMap(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfNullAsMap
in interface ExecutableMapOperator<K,V>
function
- the function to be executed on the selected elements
ILevel0MapOperator<I,K,V> execIfTrueAsMap(IFunction<? super Map<K,V>,Boolean> eval, IFunction<? super Map<K,V>,? extends Map<? extends K,? extends V>> function)
ExecutableMapOperator
Executes a function in a way equivalent to ExecutableMapOperator.execAsMap(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfTrueAsMap
in interface ExecutableMapOperator<K,V>
eval
- the evaluation function used to select elementsfunction
- the function to be executed on the selected elements
ILevel0MapOperator<I,K,V> execIfFalseAsMap(IFunction<? super Map<K,V>,Boolean> eval, IFunction<? super Map<K,V>,? extends Map<? extends K,? extends V>> function)
ExecutableMapOperator
Executes a function in a way equivalent to ExecutableMapOperator.execAsMap(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfFalseAsMap
in interface ExecutableMapOperator<K,V>
eval
- the evaluation function used to select elementsfunction
- the function to be executed on the selected elements
<X,Y> ILevel0MapOperator<I,X,Y> execIfNotNullAsMap(IFunction<? super Map<K,V>,? extends Map<X,Y>> function, IFunction<? super Map<K,V>,? extends Map<X,Y>> elseFunction)
ExecutableMapOperator
Executes a function in a way equivalent to ExecutableMapOperator.execAsMap(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfNotNullAsMap
in interface ExecutableMapOperator<K,V>
X
- the new type of the keys returned by the functionsY
- the new type of the values returned by the functionsfunction
- the function to be executed on the selected elementselseFunction
- the function to be executed on the non-selected elements
<X,Y> ILevel0MapOperator<I,X,Y> execIfNullAsMap(IFunction<? super Map<K,V>,? extends Map<X,Y>> function, IFunction<? super Map<K,V>,? extends Map<X,Y>> elseFunction)
ExecutableMapOperator
Executes a function in a way equivalent to ExecutableMapOperator.execAsMap(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfNullAsMap
in interface ExecutableMapOperator<K,V>
X
- the new type of the keys returned by the functionsY
- the new type of the values returned by the functionsfunction
- the function to be executed on the selected elementselseFunction
- the function to be executed on the non-selected elements
<X,Y> ILevel0MapOperator<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)
ExecutableMapOperator
Executes a function in a way equivalent to ExecutableMapOperator.execAsMap(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfTrueAsMap
in interface ExecutableMapOperator<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
<X,Y> ILevel0MapOperator<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)
ExecutableMapOperator
Executes a function in a way equivalent to ExecutableMapOperator.execAsMap(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfFalseAsMap
in interface ExecutableMapOperator<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
<X,Y> ILevel0MapOperator<I,X,Y> of(org.javaruntype.type.Type<X> keyType, org.javaruntype.type.Type<Y> valueType)
CastableToMapOperator
Casts the operator's target as a map of the specified types.
of
in interface CastableToMapOperator
X
- the type for the map's keysY
- the type for the map's valueskeyType
- the type for the map's keysvalueType
- the type for the map's values
<X,Y> ILevel0MapOperator<I,X,Y> castToMapOf(org.javaruntype.type.Type<X> keyType, org.javaruntype.type.Type<Y> valueType)
CastableToMapOperator
Casts the operator's target as a map of the specified types.
castToMapOf
in interface CastableToMapOperator
X
- the type for the map's keysY
- the type for the map's valueskeyType
- the type for the map's keysvalueType
- the type for the map's values
ILevel0GenericUniqOperator<I,Boolean> any(IFunction<? super Map.Entry<K,V>,Boolean> eval)
any
in interface TotalizableOperator<I,Map.Entry<K,V>>
ILevel0GenericUniqOperator<I,Boolean> all(IFunction<? super Map.Entry<K,V>,Boolean> eval)
all
in interface TotalizableOperator<I,Map.Entry<K,V>>
ILevel0MapOperator<I,K,V> reverse()
ReversibleOperator
Reverses the elements of the structure.
reverse
in interface ReversibleOperator<Map.Entry<K,V>>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |