|
||||||||||
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.fn.list.Level0ListOperator<I,T>
public final class Level0ListOperator<I,T>
Constructor Summary | |
---|---|
Level0ListOperator(Target target)
|
Method Summary | ||
---|---|---|
Level0ListOperator<I,T> |
add(T newElement)
Adds the specified element at the end of the target structure object. |
|
Level0ListOperator<I,T> |
addAll(Collection<T> collection)
Adds all the elements in the specified collection to the target structure object. |
|
Level0ListOperator<I,T> |
addAll(T... newElements)
Adds all the specified elements at the end of the target structure object. |
|
Level0GenericUniqOperator<I,Boolean> |
all(IFunction<? super T,Boolean> eval)
|
|
Level0GenericUniqOperator<I,Boolean> |
any(IFunction<? super T,Boolean> eval)
|
|
|
castToListOf(org.javaruntype.type.Type<X> type)
Casts the operator's target as a list of the specified type. |
|
Level0MapOperator<I,T,T> |
couple()
Converts the target object to a map, by using the even elements (starting at 0) as keys, and the odd elements as values. |
|
Level0MapOperator<I,T,List<T>> |
coupleAndGroup()
Converts the target object to a map, by using the even elements (starting at 0) as keys, and the odd elements as values. |
|
Level0ListOperator<I,T> |
distinct()
Removes all duplicate elements from the target collection or array. |
|
|
exec(IFunction<? super List<T>,X> function)
Executes the specified function on the target list, creating a new generic operator containing the result of the execution and setting the new operator type to the one specified. |
|
|
execAsList(IFunction<? super List<T>,? extends List<X>> function)
Executes the specified function on the target object, creating a new list operator containing the result of the execution. |
|
Level0ListOperator<I,T> |
execIfFalseAsList(IFunction<? super List<T>,Boolean> eval,
IFunction<? super List<T>,? extends List<? extends T>> function)
Executes a function in a way equivalent to ExecutableListOperator.execAsList(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
execIfFalseAsList(IFunction<? super List<T>,Boolean> eval,
IFunction<? super List<T>,? extends List<X>> function,
IFunction<? super List<T>,? extends List<X>> elseFunction)
Executes a function in a way equivalent to ExecutableListOperator.execAsList(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level0ListOperator<I,T> |
execIfNotNullAsList(IFunction<? super List<T>,? extends List<? extends T>> function)
Executes a function in a way equivalent to ExecutableListOperator.execAsList(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
execIfNotNullAsList(IFunction<? super List<T>,? extends List<X>> function,
IFunction<? super List<T>,? extends List<X>> elseFunction)
Executes a function in a way equivalent to ExecutableListOperator.execAsList(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level0ListOperator<I,T> |
execIfNullAsList(IFunction<? super List<T>,? extends List<? extends T>> function)
Executes a function in a way equivalent to ExecutableListOperator.execAsList(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
execIfNullAsList(IFunction<? super List<T>,? extends List<X>> function,
IFunction<? super List<T>,? extends List<X>> elseFunction)
Executes a function in a way equivalent to ExecutableListOperator.execAsList(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level0ListOperator<I,T> |
execIfTrueAsList(IFunction<? super List<T>,Boolean> eval,
IFunction<? super List<T>,? extends List<? extends T>> function)
Executes a function in a way equivalent to ExecutableListOperator.execAsList(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
execIfTrueAsList(IFunction<? super List<T>,Boolean> eval,
IFunction<? super List<T>,? extends List<X>> function,
IFunction<? super List<T>,? extends List<X>> elseFunction)
Executes a function in a way equivalent to ExecutableListOperator.execAsList(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level1ListElementsOperator<I,T> |
forEach()
Iterates the target collection. |
|
Level0GenericUniqOperator<I,List<T>> |
generic()
Converts the specialized structure operator into generic operators (with no specific methods for structures - e.g. forEach()) |
|
Function<I,List<T>> |
get()
Returns a function which will execute all the logic specified from the "Fn.on" expression. |
|
Level0ListSelectedOperator<I,T> |
ifFalse(IFunction<? super List<T>,Boolean> eval)
Selects only those targets for which the specified evaluator returns false. |
|
Level0ListSelectedOperator<I,T> |
ifNotNull()
Selects only those targets which are not null. |
|
Level0ListSelectedOperator<I,T> |
ifNull()
Selects only those targets which are null. |
|
Level0ListSelectedOperator<I,T> |
ifTrue(IFunction<? super List<T>,Boolean> eval)
Selects only those targets for which the specified evaluator returns true. |
|
Level0ListOperator<I,T> |
insert(int position,
T newElement)
Inserts a new element into the specified position (starting in 0) of the target structure object. |
|
Level0ListOperator<I,T> |
insertAll(int position,
T... newElements)
Inserts new elements into the specified position (starting in 0) of the target structure object. |
|
|
map(IFunction<? super T,X> function)
Executes the specified function on each of the elements, creating a new list operator containing the result of all the executions and setting the new operator type to the one resulting from the function execution. |
|
Level0ListOperator<I,T> |
mapIfFalse(IFunction<? super T,Boolean> eval,
IFunction<? super T,? extends T> function)
Maps a function in a way equivalent to ExecutableListOperator.map(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
mapIfFalse(IFunction<? super T,Boolean> eval,
IFunction<? super T,X> function,
IFunction<? super T,X> elseFunction)
Maps a function in a way equivalent to ExecutableListOperator.map(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level0ListOperator<I,T> |
mapIfNotNull(IFunction<? super T,? extends T> function)
Maps a function in a way equivalent to ExecutableListOperator.map(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
mapIfNotNull(IFunction<? super T,X> function,
IFunction<? super T,X> elseFunction)
Maps a function in a way equivalent to ExecutableListOperator.map(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level0ListOperator<I,T> |
mapIfNull(IFunction<? super T,? extends T> function)
Maps a function in a way equivalent to ExecutableListOperator.map(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
mapIfNull(IFunction<? super T,X> function,
IFunction<? super T,X> elseFunction)
Maps a function in a way equivalent to ExecutableListOperator.map(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level0ListOperator<I,T> |
mapIfTrue(IFunction<? super T,Boolean> eval,
IFunction<? super T,? extends T> function)
Maps a function in a way equivalent to ExecutableListOperator.map(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
mapIfTrue(IFunction<? super T,Boolean> eval,
IFunction<? super T,X> function,
IFunction<? super T,X> elseFunction)
Maps a function in a way equivalent to ExecutableListOperator.map(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
of(org.javaruntype.type.Type<X> type)
Casts the operator's target as a list of the specified type. |
|
Level0ListOperator<I,T> |
removeAllEqual(T... values)
Removes the specified values from the target structure object. |
|
Level0ListOperator<I,T> |
removeAllFalse(IFunction<? super T,Boolean> eval)
Removes from the target structure object all the elements which evaluate as false using the specified evaluator. |
|
Level0ListOperator<I,T> |
removeAllIndexes(int... indexes)
Removes all the elements in the target structure object which position (index) in it matches one the specified indexes. |
|
Level0ListOperator<I,T> |
removeAllIndexesNot(int... indexes)
Removes all the elements in the target structure object except those which position (index) in it matches one of the specified indexes. |
|
Level0ListOperator<I,T> |
removeAllNotNullAndFalse(IFunction<? super T,Boolean> eval)
Removes from the target structure object all the elements which are not null and evaluate as false using the specified evaluator. |
|
Level0ListOperator<I,T> |
removeAllNotNullAndTrue(IFunction<? super T,Boolean> eval)
Removes from the target structure object all the elements which are not null and evaluate as true using the specified evaluator. |
|
Level0ListOperator<I,T> |
removeAllNull()
Remove all the null elements in the target structure object. |
|
Level0ListOperator<I,T> |
removeAllNullOrFalse(IFunction<? super T,Boolean> eval)
Removes from the target structure object all the elements which either are null or evaluate as false using the specified evaluator. |
|
Level0ListOperator<I,T> |
removeAllNullOrTrue(IFunction<? super T,Boolean> eval)
Removes from the target structure object all the elements which either are null or evaluate as true using the specified evaluator. |
|
Level0ListOperator<I,T> |
removeAllTrue(IFunction<? super T,Boolean> eval)
Removes from the target structure object all the elements which evaluate as true using the specified evaluator. |
|
Level0ListOperator<I,T> |
replaceIfNullWith(List<T> replacement)
Replaces the current target object with the specified replacement if the current target is null. |
|
Level0ListOperator<I,T> |
replaceWith(List<T> replacement)
Replaces the current target object with the specified replacement. |
|
Level0ListOperator<I,T> |
reverse()
Reverses the elements of the structure. |
|
Level0ListOperator<I,T> |
sort()
Sorts the elements of the structure according to their natural ordering. |
|
Level0ListOperator<I,T> |
sort(Comparator<? super T> comparator)
Sorts the elements of the structure according to the order induced by the specified comparator. |
|
Level0ListOperator<I,T> |
sortBy(IFunction<? super T,?> by)
Sorts the elements of the structure according to the result of executing the specified function. |
|
Level0ArrayOperator<I,T> |
toArrayOf(org.javaruntype.type.Type<T> type)
Converts the current target to an array of the specified type. |
|
|
toGroupMap(IFunction<? super T,K> keyFunction,
IFunction<? super T,V> valueFunction)
Converts the target object to a map by inputting the original target's elements into the specified map builder (a function returning map entries) which will create the resulting keys and values. |
|
|
toGroupMap(IFunction<? super T,Map.Entry<K,V>> mapBuilder)
Converts the target object to a map by inputting the original target's elements into the specified map builder (a function returning map entries) which will create the resulting keys and values. |
|
|
toMap(IFunction<? super T,K> keyFunction,
IFunction<? super T,V> valueFunction)
Converts the target object to a map by inputting the original target's elements into the specified functions, which will create the resulting keys and values. |
|
|
toMap(IFunction<? super T,Map.Entry<K,V>> mapBuilder)
Converts the target object to a map by inputting the original target's elements into the specified map builder (a function returning map entries) which will create the resulting keys and values. |
|
Level0SetOperator<I,T> |
toSet()
Converts the current target into a set. |
|
|
zipAndGroupKeys(K... keys)
Converts the target object to a map by using the original target's elements as values the specified objects as keys. |
|
|
zipAndGroupKeysBy(IFunction<? super T,K> keyEval)
Converts the target object to a map by using the original target's elements as values and applying an evaluator (keyEval) to them in order to obtain their corresponding keys. |
|
|
zipAndGroupKeysFrom(Collection<K> keys)
Converts the target object to a map by using the original target's elements as values the specified objects as keys. |
|
|
zipAndGroupKeysFrom(K[] keys)
Converts the target object to a map by using the original target's elements as values the specified objects as keys. |
|
|
zipAndGroupValues(V... values)
Converts the target object to a map by using the original target's elements as keys and the specified objects as values. |
|
|
zipAndGroupValuesBy(IFunction<? super T,V> valueEval)
Converts the target object to a map by using the original target's elements as keys and applying an evaluator (valueEval) to them in order to obtain their corresponding value. |
|
|
zipAndGroupValuesFrom(Collection<V> values)
Converts the target object to a map by using the original target's elements as keys and the specified objects as values. |
|
|
zipAndGroupValuesFrom(V[] values)
Converts the target object to a map by using the original target's elements as keys and the specified objects as values. |
|
|
zipKeys(K... keys)
Converts the target object to a map by using the original target's elements as values and setting the specified objects as keys. |
|
|
zipKeysBy(IFunction<? super T,K> keyEval)
Converts the target object to a map by using the original target's elements as values and applying an evaluator (keyEval) to them in order to obtain their corresponding keys. |
|
|
zipKeysFrom(Collection<K> keys)
Converts the target object to a map by using the original target's elements as values and setting the specified objects as keys. |
|
|
zipKeysFrom(K[] keys)
Converts the target object to a map by using the original target's elements as values and setting the specified objects as keys. |
|
|
zipValues(V... values)
Converts the target object to a map by using the original target's elements as keys and applying an evaluator (valueEval) to them in order to obtain their corresponding value. |
|
|
zipValuesBy(IFunction<? super T,V> valueEval)
Converts the target object to a map by using the original target's elements as keys and applying an evaluator (valueEval) to them in order to obtain their corresponding value. |
|
|
zipValuesFrom(Collection<V> values)
Converts the target object to a map by using the original target's elements as keys and applying an evaluator (valueEval) to them in order to obtain their corresponding value. |
|
|
zipValuesFrom(V[] values)
Converts the target object to a map by using the original target's elements as keys and applying an evaluator (valueEval) to them in order to obtain their corresponding value. |
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 Level0ListOperator(Target target)
Method Detail |
---|
public Level0ListOperator<I,T> add(T newElement)
ModifiableCollectionOperator
Adds the specified element at the end of the target structure object.
The original target object is not modified, but copied instead.
add
in interface ILevel0ListOperator<I,T>
add
in interface ModifiableCollectionOperator<T>
newElement
- the element to be added
public Level0ListOperator<I,T> addAll(T... newElements)
ModifiableCollectionOperator
Adds all the specified elements at the end of the target structure object.
The original target object is not modified, but copied instead.
addAll
in interface ILevel0ListOperator<I,T>
addAll
in interface ModifiableCollectionOperator<T>
newElements
- the elements to be added
public Level0ListOperator<I,T> insert(int position, T newElement)
ModifiableCollectionOperator
Inserts a new element into the specified position (starting in 0) of the target structure object.
The original target object is not modified, but copied instead.
insert
in interface ILevel0ListOperator<I,T>
insert
in interface ModifiableCollectionOperator<T>
position
- the position in which the new element will be inserted (starting in 0)newElement
- the element to be inserted
public Level0ListOperator<I,T> insertAll(int position, T... newElements)
ModifiableCollectionOperator
Inserts new elements into the specified position (starting in 0) of the target structure object.
The original target object is not modified, but copied instead.
insertAll
in interface ILevel0ListOperator<I,T>
insertAll
in interface ModifiableCollectionOperator<T>
position
- the position in which the new element will be inserted (starting in 0)newElements
- the elements to be inserted
public Level0ListOperator<I,T> addAll(Collection<T> collection)
ModifiableCollectionOperator
Adds all the elements in the specified collection to the target structure object.
The original target object is not modified, but copied instead.
addAll
in interface ILevel0ListOperator<I,T>
addAll
in interface ModifiableCollectionOperator<T>
collection
- the collection containing the elements to be added
public Level0ListOperator<I,T> distinct()
DistinguishableOperator
Removes all duplicate elements from the target collection or array.
distinct
in interface ILevel0ListOperator<I,T>
distinct
in interface DistinguishableOperator
public Level1ListElementsOperator<I,T> forEach()
NavigableCollectionOperator
Iterates the target collection. After executing this method, any further operations will be applied on each of the collection elements until an "endFor()" method is called.
forEach
in interface ILevel0ListOperator<I,T>
forEach
in interface NavigableCollectionOperator<T>
public Level0ListOperator<I,T> removeAllIndexes(int... indexes)
ModifiableCollectionOperator
Removes all the elements in the target structure object which position (index) in it matches one the specified indexes.
The original target object is not modified, but copied instead.
removeAllIndexes
in interface ILevel0ListOperator<I,T>
removeAllIndexes
in interface ModifiableCollectionOperator<T>
indexes
- the positions of the elements to be removed
public Level0ListOperator<I,T> removeAllEqual(T... values)
ModifiableCollectionOperator
Removes the specified values from the target structure object.
The original target object is not modified, but copied instead.
removeAllEqual
in interface ILevel0ListOperator<I,T>
removeAllEqual
in interface ModifiableCollectionOperator<T>
values
- the values to be removed from the target.
public Level0ListOperator<I,T> removeAllTrue(IFunction<? super T,Boolean> eval)
ModifiableCollectionOperator
Removes from the target structure object all the elements which evaluate as true using the specified evaluator.
The original target object is not modified, but copied instead.
removeAllTrue
in interface ILevel0ListOperator<I,T>
removeAllTrue
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0ListOperator<I,T> removeAllFalse(IFunction<? super T,Boolean> eval)
ModifiableCollectionOperator
Removes from the target structure object all the elements which evaluate as false using the specified evaluator.
The original target object is not modified, but copied instead.
removeAllFalse
in interface ILevel0ListOperator<I,T>
removeAllFalse
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0ListOperator<I,T> removeAllNullOrFalse(IFunction<? super T,Boolean> eval)
ModifiableCollectionOperator
Removes from the target structure object all the elements which either are null or evaluate as false using the specified evaluator.
The original target object is not modified, but copied instead.
removeAllNullOrFalse
in interface ILevel0ListOperator<I,T>
removeAllNullOrFalse
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0ListOperator<I,T> removeAllNotNullAndFalse(IFunction<? super T,Boolean> eval)
ModifiableCollectionOperator
Removes from the target structure object all the elements which are not null and evaluate as false using the specified evaluator.
The original target object is not modified, but copied instead.
removeAllNotNullAndFalse
in interface ILevel0ListOperator<I,T>
removeAllNotNullAndFalse
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0ListOperator<I,T> removeAllNullOrTrue(IFunction<? super T,Boolean> eval)
ModifiableCollectionOperator
Removes from the target structure object all the elements which either are null or evaluate as true using the specified evaluator.
The original target object is not modified, but copied instead.
removeAllNullOrTrue
in interface ILevel0ListOperator<I,T>
removeAllNullOrTrue
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0ListOperator<I,T> removeAllNotNullAndTrue(IFunction<? super T,Boolean> eval)
ModifiableCollectionOperator
Removes from the target structure object all the elements which are not null and evaluate as true using the specified evaluator.
The original target object is not modified, but copied instead.
removeAllNotNullAndTrue
in interface ILevel0ListOperator<I,T>
removeAllNotNullAndTrue
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0ListOperator<I,T> removeAllIndexesNot(int... indexes)
ModifiableCollectionOperator
Removes all the elements in the target structure object except those which position (index) in it matches one of the specified indexes.
The original target object is not modified, but copied instead.
removeAllIndexesNot
in interface ILevel0ListOperator<I,T>
removeAllIndexesNot
in interface ModifiableCollectionOperator<T>
indexes
- the positions of the elements to be kept
public Level0ListOperator<I,T> removeAllNull()
ModifiableCollectionOperator
Remove all the null elements in the target structure object.
The original target object is not modified, but copied instead.
removeAllNull
in interface ILevel0ListOperator<I,T>
removeAllNull
in interface ModifiableCollectionOperator<T>
public Level0ListOperator<I,T> sort()
SortableOperator
Sorts the elements of the structure according to their natural ordering.
sort
in interface ILevel0ListOperator<I,T>
sort
in interface SortableOperator<T>
public Level0ListOperator<I,T> sort(Comparator<? super T> comparator)
SortableOperator
Sorts the elements of the structure according to the order induced by the specified comparator.
sort
in interface ILevel0ListOperator<I,T>
sort
in interface SortableOperator<T>
comparator
- the comparator to be used.
public Level0ArrayOperator<I,T> toArrayOf(org.javaruntype.type.Type<T> type)
ConvertibleToArrayOperator
Converts the current target to an array of the specified type.
toArrayOf
in interface ILevel0ListOperator<I,T>
toArrayOf
in interface ConvertibleToArrayOperator<T>
type
- the type of the array elements.
public Level0MapOperator<I,T,T> couple()
ConvertibleToMapOperator
Converts the target object to a map, by using the even elements (starting at 0) as keys, and the odd elements as values.
couple
in interface ILevel0ListOperator<I,T>
couple
in interface ConvertibleToMapOperator<T>
public Level0MapOperator<I,T,List<T>> coupleAndGroup()
ConvertibleToMapOfListOperator
Converts the target object to a map, by using the even elements (starting at 0) as keys, and the odd elements as values. Values with the same key will be grouped into lists.
coupleAndGroup
in interface ILevel0ListOperator<I,T>
coupleAndGroup
in interface ConvertibleToMapOfListOperator<T>
public <K> Level0MapOperator<I,K,T> zipKeysBy(IFunction<? super T,K> keyEval)
ConvertibleToMapOperator
Converts the target object to a map by using the original target's elements as values and applying an evaluator (keyEval) to them in order to obtain their corresponding keys.
Note that if more than one value get the same key, only the last one will be in the resulting map (the other ones will be overwritten).
zipKeysBy
in interface ILevel0ListOperator<I,T>
zipKeysBy
in interface ConvertibleToMapOperator<T>
K
- the type of the keys that will be createdkeyEval
- the evaluator used for obtaining the keys
public <V> Level0MapOperator<I,T,V> zipValuesBy(IFunction<? super T,V> valueEval)
ConvertibleToMapOperator
Converts the target object to a map by using the original target's elements as keys and applying an evaluator (valueEval) to them in order to obtain their corresponding value.
Note that if more than one value get the same key, only the last one will be in the resulting map (the other ones will be overwritten).
zipValuesBy
in interface ILevel0ListOperator<I,T>
zipValuesBy
in interface ConvertibleToMapOperator<T>
V
- the type of the values that will be createdvalueEval
- the evaluator used for obtaining the values
public <K> Level0MapOperator<I,K,T> zipKeys(K... keys)
ConvertibleToMapOperator
Converts the target object to a map by using the original target's elements as values and setting the specified objects as keys.
Note that if more than one value get the same key, only the last one will be in the resulting map (the other ones will be overwritten).
zipKeys
in interface ILevel0ListOperator<I,T>
zipKeys
in interface ConvertibleToMapOperator<T>
K
- the type of the keyskeys
- the new keys
public <V> Level0MapOperator<I,T,V> zipValues(V... values)
ConvertibleToMapOperator
Converts the target object to a map by using the original target's elements as keys and applying an evaluator (valueEval) to them in order to obtain their corresponding value.
zipValues
in interface ILevel0ListOperator<I,T>
zipValues
in interface ConvertibleToMapOperator<T>
V
- the type of the valuesvalues
- the new values
public <K> Level0MapOperator<I,K,List<T>> zipAndGroupKeysBy(IFunction<? super T,K> keyEval)
ConvertibleToMapOfListOperator
Converts the target object to a map by using the original target's elements as values and applying an evaluator (keyEval) to them in order to obtain their corresponding keys. Values with the same key will be grouped into lists.
zipAndGroupKeysBy
in interface ILevel0ListOperator<I,T>
zipAndGroupKeysBy
in interface ConvertibleToMapOfListOperator<T>
K
- the type of the keys that will be createdkeyEval
- the evaluator used for obtaining the keys
public <V> Level0MapOperator<I,T,List<V>> zipAndGroupValuesBy(IFunction<? super T,V> valueEval)
ConvertibleToMapOfListOperator
Converts the target object to a map by using the original target's elements as keys and applying an evaluator (valueEval) to them in order to obtain their corresponding value. Values with the same key will be grouped into lists.
zipAndGroupValuesBy
in interface ILevel0ListOperator<I,T>
zipAndGroupValuesBy
in interface ConvertibleToMapOfListOperator<T>
V
- the type of the values that will be createdvalueEval
- the evaluator used for obtaining the values
public <K> Level0MapOperator<I,K,List<T>> zipAndGroupKeys(K... keys)
ConvertibleToMapOfListOperator
Converts the target object to a map by using the original target's elements as values the specified objects as keys. Values with the same key will be grouped into lists.
zipAndGroupKeys
in interface ILevel0ListOperator<I,T>
zipAndGroupKeys
in interface ConvertibleToMapOfListOperator<T>
K
- the type of the keys that will be createdkeys
- the keys to be zipped
public <V> Level0MapOperator<I,T,List<V>> zipAndGroupValues(V... values)
ConvertibleToMapOfListOperator
Converts the target object to a map by using the original target's elements as keys and the specified objects as values. Values with the same key will be grouped into lists.
zipAndGroupValues
in interface ILevel0ListOperator<I,T>
zipAndGroupValues
in interface ConvertibleToMapOfListOperator<T>
V
- the type of the values that will be createdvalues
- the values to be zipped
public <K,V> Level0MapOperator<I,K,V> toMap(IFunction<? super T,Map.Entry<K,V>> mapBuilder)
ConvertibleToMapOperator
Converts the target object to a map by inputting the original target's elements into the specified map builder (a function returning map entries) which will create the resulting keys and values.
Note that if more than one value get the same key, only the last one will be in the resulting map (the other ones will be overwritten).
toMap
in interface ILevel0ListOperator<I,T>
toMap
in interface ConvertibleToMapOperator<T>
K
- the type of the keys that will be createdV
- the type of the values that will be createdmapBuilder
- the map builder function to be used
public <K,V> Level0MapOperator<I,K,List<V>> toGroupMap(IFunction<? super T,Map.Entry<K,V>> mapBuilder)
ConvertibleToMapOfListOperator
Converts the target object to a map by inputting the original target's elements into the specified map builder (a function returning map entries) which will create the resulting keys and values. Values with the same key will be grouped into lists.
toGroupMap
in interface ILevel0ListOperator<I,T>
toGroupMap
in interface ConvertibleToMapOfListOperator<T>
K
- the type of the keys that will be createdV
- the type of the values that will be createdmapBuilder
- the map builder function to be used
public Level0SetOperator<I,T> toSet()
ConvertibleToSetOperator
Converts the current target into a set.
toSet
in interface ILevel0ListOperator<I,T>
toSet
in interface ConvertibleToSetOperator
public Function<I,List<T>> get()
UniqFnOperator
Returns a function which will execute all the logic specified from the "Fn.on" expression.
get
in interface UniqFnOperator<I,List<T>>
public Level0GenericUniqOperator<I,List<T>> generic()
GenerizableOperator
Converts the specialized structure operator into generic operators (with no specific methods for structures - e.g. forEach())
generic
in interface ILevel0ListOperator<I,T>
generic
in interface GenerizableOperator<I,List<T>>
public <X> Level0ListOperator<I,X> of(org.javaruntype.type.Type<X> type)
CastableToListOperator
Casts the operator's target as a list of the specified type.
of
in interface ILevel0ListOperator<I,T>
of
in interface CastableToListOperator
X
- the type of the elements of the listtype
- the type of the elements of the list
public <X> Level0ListOperator<I,X> castToListOf(org.javaruntype.type.Type<X> type)
CastableToListOperator
Casts the operator's target as a list of the specified type.
castToListOf
in interface ILevel0ListOperator<I,T>
castToListOf
in interface CastableToListOperator
X
- the type of the elements of the listtype
- the type of the elements of the list
public Level0ListSelectedOperator<I,T> ifTrue(IFunction<? super List<T>,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 ILevel0ListOperator<I,T>
ifTrue
in interface SelectableOperator<List<T>>
eval
- the evaluator to be used for selecting targets.
public Level0ListSelectedOperator<I,T> ifFalse(IFunction<? super List<T>,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 ILevel0ListOperator<I,T>
ifFalse
in interface SelectableOperator<List<T>>
eval
- the evaluator to be used for selecting targets.
public Level0ListSelectedOperator<I,T> 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 ILevel0ListOperator<I,T>
ifNotNull
in interface SelectableOperator<List<T>>
public Level0ListSelectedOperator<I,T> 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 ILevel0ListOperator<I,T>
ifNull
in interface SelectableOperator<List<T>>
public <X> Level0ListOperator<I,X> execAsList(IFunction<? super List<T>,? extends List<X>> function)
ExecutableListOperator
Executes the specified function on the target object, creating a new list operator containing the result of the execution.
This function must be able to take as input a list of the current operator's target type, and can return a list of a different type, which will be from then on the new operator's target type.
execAsList
in interface ILevel0ListOperator<I,T>
execAsList
in interface ExecutableListOperator<T>
X
- the type of the result elementsfunction
- the function to be executed
public <X> Level0GenericUniqOperator<I,X> exec(IFunction<? super List<T>,X> function)
ExecutableListOperator
Executes the specified function on the target list, creating a new generic operator containing the result of the execution and setting the new operator type to the one specified.
exec
in interface ILevel0ListOperator<I,T>
exec
in interface ExecutableListOperator<T>
X
- the type of the result objectfunction
- the function to be executed
public Level0ListOperator<I,T> replaceWith(List<T> replacement)
ReplaceableOperator
Replaces the current target object with the specified replacement.
replaceWith
in interface ILevel0ListOperator<I,T>
replaceWith
in interface ReplaceableOperator<List<T>>
replacement
- the object which will replace the current target object.
public Level0ListOperator<I,T> replaceIfNullWith(List<T> replacement)
ReplaceableIfNullOperator
Replaces the current target object with the specified replacement if the current target is null.
replaceIfNullWith
in interface ILevel0ListOperator<I,T>
replaceIfNullWith
in interface ReplaceableIfNullOperator<List<T>>
replacement
- the object which will replace the current target object if target is null.
public <X> Level0ListOperator<I,X> map(IFunction<? super T,X> function)
ExecutableListOperator
Executes the specified function on each of the elements, creating a new list operator containing the result of all the executions and setting the new operator type to the one resulting from the function execution.
This method is equivalent to forEach().exec(function).endFor().
map
in interface ILevel0ListOperator<I,T>
map
in interface ExecutableListOperator<T>
X
- the type of the result elementsfunction
- the function to be executed
public Level0GenericUniqOperator<I,Boolean> all(IFunction<? super T,Boolean> eval)
all
in interface ILevel0ListOperator<I,T>
all
in interface TotalizableOperator<I,T>
public Level0GenericUniqOperator<I,Boolean> any(IFunction<? super T,Boolean> eval)
any
in interface ILevel0ListOperator<I,T>
any
in interface TotalizableOperator<I,T>
public Level0ListOperator<I,T> sortBy(IFunction<? super T,?> by)
SortableOperator
Sorts the elements of the structure according to the result of executing the specified function.
sortBy
in interface ILevel0ListOperator<I,T>
sortBy
in interface SortableOperator<T>
by
- the function to be executed in order to obtain the compared object
public <K> Level0MapOperator<I,K,List<T>> zipAndGroupKeysFrom(Collection<K> keys)
ConvertibleToMapOfListOperator
Converts the target object to a map by using the original target's elements as values the specified objects as keys. Values with the same key will be grouped into lists.
zipAndGroupKeysFrom
in interface ILevel0ListOperator<I,T>
zipAndGroupKeysFrom
in interface ConvertibleToMapOfListOperator<T>
K
- the type of the keys that will be createdkeys
- the keys to be zipped
public <K> Level0MapOperator<I,K,List<T>> zipAndGroupKeysFrom(K[] keys)
ConvertibleToMapOfListOperator
Converts the target object to a map by using the original target's elements as values the specified objects as keys. Values with the same key will be grouped into lists.
zipAndGroupKeysFrom
in interface ILevel0ListOperator<I,T>
zipAndGroupKeysFrom
in interface ConvertibleToMapOfListOperator<T>
K
- the type of the keys that will be createdkeys
- the keys to be zipped
public <V> Level0MapOperator<I,T,List<V>> zipAndGroupValuesFrom(Collection<V> values)
ConvertibleToMapOfListOperator
Converts the target object to a map by using the original target's elements as keys and the specified objects as values. Values with the same key will be grouped into lists.
zipAndGroupValuesFrom
in interface ILevel0ListOperator<I,T>
zipAndGroupValuesFrom
in interface ConvertibleToMapOfListOperator<T>
V
- the type of the values that will be createdvalues
- the values to be zipped
public <V> Level0MapOperator<I,T,List<V>> zipAndGroupValuesFrom(V[] values)
ConvertibleToMapOfListOperator
Converts the target object to a map by using the original target's elements as keys and the specified objects as values. Values with the same key will be grouped into lists.
zipAndGroupValuesFrom
in interface ILevel0ListOperator<I,T>
zipAndGroupValuesFrom
in interface ConvertibleToMapOfListOperator<T>
V
- the type of the values that will be createdvalues
- the values to be zipped
public <K> Level0MapOperator<I,K,T> zipKeysFrom(Collection<K> keys)
ConvertibleToMapOperator
Converts the target object to a map by using the original target's elements as values and setting the specified objects as keys.
Note that if more than one value get the same key, only the last one will be in the resulting map (the other ones will be overwritten).
zipKeysFrom
in interface ILevel0ListOperator<I,T>
zipKeysFrom
in interface ConvertibleToMapOperator<T>
K
- the type of the keyskeys
- the new keys
public <K> Level0MapOperator<I,K,T> zipKeysFrom(K[] keys)
ConvertibleToMapOperator
Converts the target object to a map by using the original target's elements as values and setting the specified objects as keys.
Note that if more than one value get the same key, only the last one will be in the resulting map (the other ones will be overwritten).
zipKeysFrom
in interface ILevel0ListOperator<I,T>
zipKeysFrom
in interface ConvertibleToMapOperator<T>
K
- the type of the keyskeys
- the new keys
public <V> Level0MapOperator<I,T,V> zipValuesFrom(Collection<V> values)
ConvertibleToMapOperator
Converts the target object to a map by using the original target's elements as keys and applying an evaluator (valueEval) to them in order to obtain their corresponding value.
zipValuesFrom
in interface ILevel0ListOperator<I,T>
zipValuesFrom
in interface ConvertibleToMapOperator<T>
V
- the type of the valuesvalues
- the new values
public <V> Level0MapOperator<I,T,V> zipValuesFrom(V[] values)
ConvertibleToMapOperator
Converts the target object to a map by using the original target's elements as keys and applying an evaluator (valueEval) to them in order to obtain their corresponding value.
zipValuesFrom
in interface ILevel0ListOperator<I,T>
zipValuesFrom
in interface ConvertibleToMapOperator<T>
V
- the type of the valuesvalues
- the new values
public Level0ListOperator<I,T> reverse()
ReversibleOperator
Reverses the elements of the structure.
reverse
in interface ILevel0ListOperator<I,T>
reverse
in interface ReversibleOperator<T>
public <K,V> Level0MapOperator<I,K,List<V>> toGroupMap(IFunction<? super T,K> keyFunction, IFunction<? super T,V> valueFunction)
ConvertibleToMapOfListOperator
Converts the target object to a map by inputting the original target's elements into the specified map builder (a function returning map entries) which will create the resulting keys and values. Values with the same key will be grouped into lists.
toGroupMap
in interface ILevel0ListOperator<I,T>
toGroupMap
in interface ConvertibleToMapOfListOperator<T>
K
- the type of the keys that will be createdV
- the type of the values that will be createdkeyFunction
- the function for building the keysvalueFunction
- the function for building the values
public <K,V> Level0MapOperator<I,K,V> toMap(IFunction<? super T,K> keyFunction, IFunction<? super T,V> valueFunction)
ConvertibleToMapOperator
Converts the target object to a map by inputting the original target's elements into the specified functions, which will create the resulting keys and values.
Note that if more than one value get the same key, only the last one will be in the resulting map (the other ones will be overwritten).
toMap
in interface ILevel0ListOperator<I,T>
toMap
in interface ConvertibleToMapOperator<T>
K
- the type of the keys that will be createdV
- the type of the values that will be createdkeyFunction
- the function for building the keysvalueFunction
- the function for building the values
public Level0ListOperator<I,T> execIfFalseAsList(IFunction<? super List<T>,Boolean> eval, IFunction<? super List<T>,? extends List<? extends T>> function)
ExecutableListOperator
Executes a function in a way equivalent to ExecutableListOperator.execAsList(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfFalseAsList
in interface ILevel0ListOperator<I,T>
execIfFalseAsList
in interface ExecutableListOperator<T>
eval
- the evaluation function used to select elementsfunction
- the function to be executed on the selected elements
public <X> Level0ListOperator<I,X> execIfFalseAsList(IFunction<? super List<T>,Boolean> eval, IFunction<? super List<T>,? extends List<X>> function, IFunction<? super List<T>,? extends List<X>> elseFunction)
ExecutableListOperator
Executes a function in a way equivalent to ExecutableListOperator.execAsList(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfFalseAsList
in interface ILevel0ListOperator<I,T>
execIfFalseAsList
in interface ExecutableListOperator<T>
X
- the new type 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 Level0ListOperator<I,T> execIfNotNullAsList(IFunction<? super List<T>,? extends List<? extends T>> function)
ExecutableListOperator
Executes a function in a way equivalent to ExecutableListOperator.execAsList(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfNotNullAsList
in interface ILevel0ListOperator<I,T>
execIfNotNullAsList
in interface ExecutableListOperator<T>
function
- the function to be executed on the selected elements
public <X> Level0ListOperator<I,X> execIfNotNullAsList(IFunction<? super List<T>,? extends List<X>> function, IFunction<? super List<T>,? extends List<X>> elseFunction)
ExecutableListOperator
Executes a function in a way equivalent to ExecutableListOperator.execAsList(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfNotNullAsList
in interface ILevel0ListOperator<I,T>
execIfNotNullAsList
in interface ExecutableListOperator<T>
X
- the new type returned by the functionsfunction
- the function to be executed on the selected elementselseFunction
- the function to be executed on the non-selected elements
public Level0ListOperator<I,T> execIfNullAsList(IFunction<? super List<T>,? extends List<? extends T>> function)
ExecutableListOperator
Executes a function in a way equivalent to ExecutableListOperator.execAsList(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfNullAsList
in interface ILevel0ListOperator<I,T>
execIfNullAsList
in interface ExecutableListOperator<T>
function
- the function to be executed on the selected elements
public <X> Level0ListOperator<I,X> execIfNullAsList(IFunction<? super List<T>,? extends List<X>> function, IFunction<? super List<T>,? extends List<X>> elseFunction)
ExecutableListOperator
Executes a function in a way equivalent to ExecutableListOperator.execAsList(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfNullAsList
in interface ILevel0ListOperator<I,T>
execIfNullAsList
in interface ExecutableListOperator<T>
X
- the new type returned by the functionsfunction
- the function to be executed on the selected elementselseFunction
- the function to be executed on the non-selected elements
public Level0ListOperator<I,T> execIfTrueAsList(IFunction<? super List<T>,Boolean> eval, IFunction<? super List<T>,? extends List<? extends T>> function)
ExecutableListOperator
Executes a function in a way equivalent to ExecutableListOperator.execAsList(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfTrueAsList
in interface ILevel0ListOperator<I,T>
execIfTrueAsList
in interface ExecutableListOperator<T>
eval
- the evaluation function used to select elementsfunction
- the function to be executed on the selected elements
public <X> Level0ListOperator<I,X> execIfTrueAsList(IFunction<? super List<T>,Boolean> eval, IFunction<? super List<T>,? extends List<X>> function, IFunction<? super List<T>,? extends List<X>> elseFunction)
ExecutableListOperator
Executes a function in a way equivalent to ExecutableListOperator.execAsList(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfTrueAsList
in interface ILevel0ListOperator<I,T>
execIfTrueAsList
in interface ExecutableListOperator<T>
X
- the new type 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 Level0ListOperator<I,T> mapIfFalse(IFunction<? super T,Boolean> eval, IFunction<? super T,? extends T> function)
ExecutableListOperator
Maps a function in a way equivalent to ExecutableListOperator.map(IFunction)
but only
on selected elements, leaving all other elements untouched.
mapIfFalse
in interface ILevel0ListOperator<I,T>
mapIfFalse
in interface ExecutableListOperator<T>
eval
- the evaluation function used to select elementsfunction
- the function to be executed on the selected elements
public <X> Level0ListOperator<I,X> mapIfFalse(IFunction<? super T,Boolean> eval, IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
ExecutableListOperator
Maps a function in a way equivalent to ExecutableListOperator.map(IFunction)
but only
on selected elements, leaving all other elements untouched.
mapIfFalse
in interface ILevel0ListOperator<I,T>
mapIfFalse
in interface ExecutableListOperator<T>
X
- the new type 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 Level0ListOperator<I,T> mapIfNotNull(IFunction<? super T,? extends T> function)
ExecutableListOperator
Maps a function in a way equivalent to ExecutableListOperator.map(IFunction)
but only
on selected elements, leaving all other elements untouched.
mapIfNotNull
in interface ILevel0ListOperator<I,T>
mapIfNotNull
in interface ExecutableListOperator<T>
function
- the function to be executed on the selected elements
public <X> Level0ListOperator<I,X> mapIfNotNull(IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
ExecutableListOperator
Maps a function in a way equivalent to ExecutableListOperator.map(IFunction)
but only
on selected elements, leaving all other elements untouched.
mapIfNotNull
in interface ILevel0ListOperator<I,T>
mapIfNotNull
in interface ExecutableListOperator<T>
X
- the new type returned by the functionsfunction
- the function to be executed on the selected elementselseFunction
- the function to be executed on the non-selected elements
public Level0ListOperator<I,T> mapIfNull(IFunction<? super T,? extends T> function)
ExecutableListOperator
Maps a function in a way equivalent to ExecutableListOperator.map(IFunction)
but only
on selected elements, leaving all other elements untouched.
mapIfNull
in interface ILevel0ListOperator<I,T>
mapIfNull
in interface ExecutableListOperator<T>
function
- the function to be executed on the selected elements
public <X> Level0ListOperator<I,X> mapIfNull(IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
ExecutableListOperator
Maps a function in a way equivalent to ExecutableListOperator.map(IFunction)
but only
on selected elements, leaving all other elements untouched.
mapIfNull
in interface ILevel0ListOperator<I,T>
mapIfNull
in interface ExecutableListOperator<T>
X
- the new type returned by the functionsfunction
- the function to be executed on the selected elementselseFunction
- the function to be executed on the non-selected elements
public Level0ListOperator<I,T> mapIfTrue(IFunction<? super T,Boolean> eval, IFunction<? super T,? extends T> function)
ExecutableListOperator
Maps a function in a way equivalent to ExecutableListOperator.map(IFunction)
but only
on selected elements, leaving all other elements untouched.
mapIfTrue
in interface ILevel0ListOperator<I,T>
mapIfTrue
in interface ExecutableListOperator<T>
eval
- the evaluation function used to select elementsfunction
- the function to be executed on the selected elements
public <X> Level0ListOperator<I,X> mapIfTrue(IFunction<? super T,Boolean> eval, IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
ExecutableListOperator
Maps a function in a way equivalent to ExecutableListOperator.map(IFunction)
but only
on selected elements, leaving all other elements untouched.
mapIfTrue
in interface ILevel0ListOperator<I,T>
mapIfTrue
in interface ExecutableListOperator<T>
X
- the new type 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 |