|
||||||||||
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.array.Level0ArrayOperator<I,T>
public final class Level0ArrayOperator<I,T>
Constructor Summary | |
---|---|
Level0ArrayOperator(org.javaruntype.type.Type<T> type,
Target target)
|
Method Summary | ||
---|---|---|
Level0ArrayOperator<I,T> |
add(T newElement)
Adds the specified element at the end of the target structure object. |
|
Level0ArrayOperator<I,T> |
addAll(Collection<T> collection)
Adds all the elements in the specified collection to the target structure object. |
|
Level0ArrayOperator<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)
|
|
|
castToArrayOf(org.javaruntype.type.Type<X> newType)
Casts the operator's target as an array 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,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. |
|
Level0ArrayOperator<I,T> |
distinct()
Removes all duplicate elements from the target collection or array. |
|
|
exec(IFunction<? super T[],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. |
|
Level0ArrayOperator<I,T> |
execAsArray(IFunction<? super T[],? extends T[]> function)
Executes the specified function on the target object, creating a new operator containing the result of the execution. |
|
|
execAsArrayOf(org.javaruntype.type.Type<X> newType,
IFunction<? super T[],X[]> function)
Executes the specified function on the target object, creating a new operator containing the result of the execution. |
|
Level0ArrayOperator<I,T> |
execIfFalseAsArray(IFunction<? super T[],Boolean> eval,
IFunction<? super T[],? extends T[]> function)
Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
execIfFalseAsArrayOf(org.javaruntype.type.Type<X> newType,
IFunction<? super T[],Boolean> eval,
IFunction<? super T[],X[]> function,
IFunction<? super T[],X[]> elseFunction)
Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level0ArrayOperator<I,T> |
execIfNotNullAsArray(IFunction<? super T[],? extends T[]> function)
Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
execIfNotNullAsArrayOf(org.javaruntype.type.Type<X> newType,
IFunction<? super T[],X[]> function,
IFunction<? super T[],X[]> elseFunction)
Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level0ArrayOperator<I,T> |
execIfNullAsArray(IFunction<? super T[],? extends T[]> function)
Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
execIfNullAsArrayOf(org.javaruntype.type.Type<X> newType,
IFunction<? super T[],X[]> function,
IFunction<? super T[],X[]> elseFunction)
Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level0ArrayOperator<I,T> |
execIfTrueAsArray(IFunction<? super T[],Boolean> eval,
IFunction<? super T[],? extends T[]> function)
Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
execIfTrueAsArrayOf(org.javaruntype.type.Type<X> newType,
IFunction<? super T[],Boolean> eval,
IFunction<? super T[],X[]> function,
IFunction<? super T[],X[]> elseFunction)
Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level1ArrayElementsOperator<I,T> |
forEach()
Iterates the target collection. |
|
Level0GenericUniqOperator<I,T[]> |
generic()
Converts the specialized structure operator into generic operators (with no specific methods for structures - e.g. forEach()) |
|
Function<I,T[]> |
get()
Returns a function which will execute all the logic specified from the "Fn.on" expression. |
|
Level0ArraySelectedOperator<I,T> |
ifFalse(IFunction<? super T[],Boolean> eval)
Selects only those targets for which the specified evaluator returns false. |
|
Level0ArraySelectedOperator<I,T> |
ifNotNull()
Selects only those targets which are not null. |
|
Level0ArraySelectedOperator<I,T> |
ifNull()
Selects only those targets which are null. |
|
Level0ArraySelectedOperator<I,T> |
ifTrue(IFunction<? super T[],Boolean> eval)
Selects only those targets for which the specified evaluator returns true. |
|
Level0ArrayOperator<I,T> |
insert(int position,
T newElement)
Inserts a new element into the specified position (starting in 0) of the target structure object. |
|
Level0ArrayOperator<I,T> |
insertAll(int position,
T... newElements)
Inserts new elements into the specified position (starting in 0) of the target structure object. |
|
Level0ArrayOperator<I,T> |
map(IFunction<? super T,? extends T> function)
Executes the specified function on each of the elements, creating a new operator containing the result of all the executions but not changing the operator type. |
|
|
map(org.javaruntype.type.Type<X> newType,
IFunction<? super T,X> function)
Executes the specified function on each of the elements, creating a new operator containing the result of all the executions and setting the new operator type to the one specified. |
|
Level0ArrayOperator<I,T> |
mapIfFalse(IFunction<? super T,Boolean> eval,
IFunction<? super T,? extends T> function)
Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
mapIfFalse(org.javaruntype.type.Type<X> newType,
IFunction<? super T,Boolean> eval,
IFunction<? super T,X> function,
IFunction<? super T,X> elseFunction)
Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level0ArrayOperator<I,T> |
mapIfNotNull(IFunction<? super T,? extends T> function)
Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
mapIfNotNull(org.javaruntype.type.Type<X> newType,
IFunction<? super T,X> function,
IFunction<? super T,X> elseFunction)
Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level0ArrayOperator<I,T> |
mapIfNull(IFunction<? super T,? extends T> function)
Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
mapIfNull(org.javaruntype.type.Type<X> newType,
IFunction<? super T,X> function,
IFunction<? super T,X> elseFunction)
Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level0ArrayOperator<I,T> |
mapIfTrue(IFunction<? super T,Boolean> eval,
IFunction<? super T,? extends T> function)
Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
mapIfTrue(org.javaruntype.type.Type<X> newType,
IFunction<? super T,Boolean> eval,
IFunction<? super T,X> function,
IFunction<? super T,X> elseFunction)
Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
of(org.javaruntype.type.Type<X> newType)
Casts the operator's target as an array of the specified type. |
|
Level0ArrayOperator<I,T> |
removeAllEqual(T... values)
Removes the specified values from the target structure object. |
|
Level0ArrayOperator<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. |
|
Level0ArrayOperator<I,T> |
removeAllIndexes(int... indexes)
Removes all the elements in the target structure object which position (index) in it matches one the specified indexes. |
|
Level0ArrayOperator<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. |
|
Level0ArrayOperator<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. |
|
Level0ArrayOperator<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. |
|
Level0ArrayOperator<I,T> |
removeAllNull()
Remove all the null elements in the target structure object. |
|
Level0ArrayOperator<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. |
|
Level0ArrayOperator<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. |
|
Level0ArrayOperator<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. |
|
Level0ArrayOperator<I,T> |
replaceIfNullWith(T[] replacement)
Replaces the current target object with the specified replacement if the current target is null. |
|
Level0ArrayOperator<I,T> |
replaceWith(T[] replacement)
Replaces the current target object with the specified replacement. |
|
Level0ArrayOperator<I,T> |
reverse()
Reverses the elements of the structure. |
|
Level0ArrayOperator<I,T> |
sort()
Sorts the elements of the structure according to their natural ordering. |
|
Level0ArrayOperator<I,T> |
sort(Comparator<? super T> comparator)
Sorts the elements of the structure according to the order induced by the specified comparator. |
|
Level0ArrayOperator<I,T> |
sortBy(IFunction<? super T,?> by)
Sorts the elements of the structure according to the result of executing the specified function. |
|
|
toGroupMapOf(org.javaruntype.type.Type<V> valueType,
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. |
|
|
toGroupMapOf(org.javaruntype.type.Type<V> valueType,
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. |
|
Level0ListOperator<I,T> |
toList()
Converts the current target to a list. |
|
|
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(org.javaruntype.type.Type<V> valueType,
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(org.javaruntype.type.Type<V> valueType,
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(org.javaruntype.type.Type<V> valueType,
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(org.javaruntype.type.Type<V> valueType,
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 Level0ArrayOperator(org.javaruntype.type.Type<T> type, Target target)
Method Detail |
---|
public Level0ArrayOperator<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 ILevel0ArrayOperator<I,T>
add
in interface ModifiableCollectionOperator<T>
newElement
- the element to be added
public Level0ArrayOperator<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 ILevel0ArrayOperator<I,T>
addAll
in interface ModifiableCollectionOperator<T>
newElements
- the elements to be added
public Level0ArrayOperator<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 ILevel0ArrayOperator<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 Level0ArrayOperator<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 ILevel0ArrayOperator<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 Level0ArrayOperator<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 ILevel0ArrayOperator<I,T>
addAll
in interface ModifiableCollectionOperator<T>
collection
- the collection containing the elements to be added
public Level0ArrayOperator<I,T> distinct()
DistinguishableOperator
Removes all duplicate elements from the target collection or array.
distinct
in interface ILevel0ArrayOperator<I,T>
distinct
in interface DistinguishableOperator
public Level1ArrayElementsOperator<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 ILevel0ArrayOperator<I,T>
forEach
in interface NavigableCollectionOperator<T>
public Level0ArrayOperator<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 ILevel0ArrayOperator<I,T>
removeAllIndexes
in interface ModifiableCollectionOperator<T>
indexes
- the positions of the elements to be removed
public Level0ArrayOperator<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 ILevel0ArrayOperator<I,T>
removeAllEqual
in interface ModifiableCollectionOperator<T>
values
- the values to be removed from the target.
public Level0ArrayOperator<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 ILevel0ArrayOperator<I,T>
removeAllTrue
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0ArrayOperator<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 ILevel0ArrayOperator<I,T>
removeAllFalse
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0ArrayOperator<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 ILevel0ArrayOperator<I,T>
removeAllNullOrFalse
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0ArrayOperator<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 ILevel0ArrayOperator<I,T>
removeAllNotNullAndFalse
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0ArrayOperator<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 ILevel0ArrayOperator<I,T>
removeAllNullOrTrue
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0ArrayOperator<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 ILevel0ArrayOperator<I,T>
removeAllNotNullAndTrue
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0ArrayOperator<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 ILevel0ArrayOperator<I,T>
removeAllIndexesNot
in interface ModifiableCollectionOperator<T>
indexes
- the positions of the elements to be kept
public Level0ArrayOperator<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 ILevel0ArrayOperator<I,T>
removeAllNull
in interface ModifiableCollectionOperator<T>
public Level0ArrayOperator<I,T> sort()
SortableOperator
Sorts the elements of the structure according to their natural ordering.
sort
in interface ILevel0ArrayOperator<I,T>
sort
in interface SortableOperator<T>
public Level0ArrayOperator<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 ILevel0ArrayOperator<I,T>
sort
in interface SortableOperator<T>
comparator
- the comparator to be used.
public Level0ListOperator<I,T> toList()
ConvertibleToListOperator
Converts the current target to a list.
toList
in interface ILevel0ArrayOperator<I,T>
toList
in interface ConvertibleToListOperator
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 ILevel0ArrayOperator<I,T>
couple
in interface ConvertibleToMapOperator<T>
public Level0MapOperator<I,T,T[]> coupleAndGroup()
ConvertibleToMapOfArrayOperator
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 arrays.
coupleAndGroup
in interface ILevel0ArrayOperator<I,T>
coupleAndGroup
in interface ConvertibleToMapOfArrayOperator<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 ILevel0ArrayOperator<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 ILevel0ArrayOperator<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 ILevel0ArrayOperator<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 ILevel0ArrayOperator<I,T>
zipValues
in interface ConvertibleToMapOperator<T>
V
- the type of the valuesvalues
- the new values
public <K> Level0MapOperator<I,K,T[]> zipAndGroupKeysBy(IFunction<? super T,K> keyEval)
ConvertibleToMapOfArrayOperator
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 arrays.
zipAndGroupKeysBy
in interface ILevel0ArrayOperator<I,T>
zipAndGroupKeysBy
in interface ConvertibleToMapOfArrayOperator<T>
K
- the type of the keys that will be createdkeyEval
- the evaluator used for obtaining the keys
public <V> Level0MapOperator<I,T,V[]> zipAndGroupValuesBy(org.javaruntype.type.Type<V> valueType, IFunction<? super T,V> valueEval)
ConvertibleToMapOfArrayOperator
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 arrays.
zipAndGroupValuesBy
in interface ILevel0ArrayOperator<I,T>
zipAndGroupValuesBy
in interface ConvertibleToMapOfArrayOperator<T>
V
- the type of the values that will be createdvalueType
- the type of the values, that will be used for instantiating the value arraysvalueEval
- the evaluator used for obtaining the values
public <K> Level0MapOperator<I,K,T[]> zipAndGroupKeys(K... keys)
ConvertibleToMapOfArrayOperator
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 arrays.
zipAndGroupKeys
in interface ILevel0ArrayOperator<I,T>
zipAndGroupKeys
in interface ConvertibleToMapOfArrayOperator<T>
K
- the type of the keys that will be createdkeys
- the keys to be zipped
public <V> Level0MapOperator<I,T,V[]> zipAndGroupValues(org.javaruntype.type.Type<V> valueType, V... values)
ConvertibleToMapOfArrayOperator
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 arrays.
zipAndGroupValues
in interface ILevel0ArrayOperator<I,T>
zipAndGroupValues
in interface ConvertibleToMapOfArrayOperator<T>
V
- the type of the values that will be createdvalueType
- the type of the values, that will be used for instantiating the value arraysvalues
- 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 ILevel0ArrayOperator<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,V[]> toGroupMapOf(org.javaruntype.type.Type<V> valueType, IFunction<? super T,Map.Entry<K,V>> mapBuilder)
ConvertibleToMapOfArrayOperator
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 arrays.
toGroupMapOf
in interface ILevel0ArrayOperator<I,T>
toGroupMapOf
in interface ConvertibleToMapOfArrayOperator<T>
K
- the type of the keys that will be createdV
- the type of the values that will be createdvalueType
- the type of the values, that will be used for instantiating the value arraysmapBuilder
- the map builder function to be used
public Level0SetOperator<I,T> toSet()
ConvertibleToSetOperator
Converts the current target into a set.
toSet
in interface ILevel0ArrayOperator<I,T>
toSet
in interface ConvertibleToSetOperator
public Function<I,T[]> get()
UniqFnOperator
Returns a function which will execute all the logic specified from the "Fn.on" expression.
get
in interface UniqFnOperator<I,T[]>
public Level0GenericUniqOperator<I,T[]> generic()
GenerizableOperator
Converts the specialized structure operator into generic operators (with no specific methods for structures - e.g. forEach())
generic
in interface ILevel0ArrayOperator<I,T>
generic
in interface GenerizableOperator<I,T[]>
public <X> Level0ArrayOperator<I,X> of(org.javaruntype.type.Type<X> newType)
CastableToArrayOperator
Casts the operator's target as an array of the specified type.
of
in interface ILevel0ArrayOperator<I,T>
of
in interface CastableToArrayOperator
X
- the type of the elements of the arraynewType
- the type of the elements of the array
public <X> Level0ArrayOperator<I,X> castToArrayOf(org.javaruntype.type.Type<X> newType)
CastableToArrayOperator
Casts the operator's target as an array of the specified type.
castToArrayOf
in interface ILevel0ArrayOperator<I,T>
castToArrayOf
in interface CastableToArrayOperator
X
- the type of the elements of the arraynewType
- the type of the elements of the array
public Level0ArraySelectedOperator<I,T> ifTrue(IFunction<? super 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 ILevel0ArrayOperator<I,T>
ifTrue
in interface SelectableOperator<T[]>
eval
- the evaluator to be used for selecting targets.
public Level0ArraySelectedOperator<I,T> ifFalse(IFunction<? super 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 ILevel0ArrayOperator<I,T>
ifFalse
in interface SelectableOperator<T[]>
eval
- the evaluator to be used for selecting targets.
public Level0ArraySelectedOperator<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 ILevel0ArrayOperator<I,T>
ifNotNull
in interface SelectableOperator<T[]>
public Level0ArraySelectedOperator<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 ILevel0ArrayOperator<I,T>
ifNull
in interface SelectableOperator<T[]>
public Level0ArrayOperator<I,T> execAsArray(IFunction<? super T[],? extends T[]> function)
ExecutableArrayOperator
Executes the specified function on the target object, creating a new operator containing the result of the execution.
This function must be able to take as input an array of the current operator's target type, and will return an array of the same type and structure.
execAsArray
in interface ILevel0ArrayOperator<I,T>
execAsArray
in interface ExecutableArrayOperator<T>
function
- the function to be executed
public <X> Level0ArrayOperator<I,X> execAsArrayOf(org.javaruntype.type.Type<X> newType, IFunction<? super T[],X[]> function)
ExecutableArrayOperator
Executes the specified function on the target object, creating a new operator containing the result of the execution.
This function must be able to take as input an array of the current operator's target type, and can return an array of a different type (specified by the type parameter), which will be from then on the new operator's target type.
execAsArrayOf
in interface ILevel0ArrayOperator<I,T>
execAsArrayOf
in interface ExecutableArrayOperator<T>
X
- the type of the result elementsnewType
- the new type for the operatorfunction
- the function to be executed
public <X> Level0GenericUniqOperator<I,X> exec(IFunction<? super T[],X> function)
ExecutableArrayOperator
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 ILevel0ArrayOperator<I,T>
exec
in interface ExecutableArrayOperator<T>
X
- the type of the result objectfunction
- the function to be executed
public Level0ArrayOperator<I,T> replaceWith(T[] replacement)
ReplaceableOperator
Replaces the current target object with the specified replacement.
replaceWith
in interface ILevel0ArrayOperator<I,T>
replaceWith
in interface ReplaceableOperator<T[]>
replacement
- the object which will replace the current target object.
public Level0ArrayOperator<I,T> replaceIfNullWith(T[] replacement)
ReplaceableIfNullOperator
Replaces the current target object with the specified replacement if the current target is null.
replaceIfNullWith
in interface ILevel0ArrayOperator<I,T>
replaceIfNullWith
in interface ReplaceableIfNullOperator<T[]>
replacement
- the object which will replace the current target object if target is null.
public <X> Level0ArrayOperator<I,X> map(org.javaruntype.type.Type<X> newType, IFunction<? super T,X> function)
ExecutableArrayOperator
Executes the specified function on each of the elements, creating a new operator containing the result of all the executions and setting the new operator type to the one specified.
This method is equivalent to forEach().exec(type, function).endFor().
map
in interface ILevel0ArrayOperator<I,T>
map
in interface ExecutableArrayOperator<T>
X
- the type of the result elementsnewType
- the new type for the operatorfunction
- the function to be executed
public Level0ArrayOperator<I,T> map(IFunction<? super T,? extends T> function)
ExecutableArrayOperator
Executes the specified function on each of the elements, creating a new operator containing the result of all the executions but not changing the operator type. The specified function will have to return results compatible with the current operator type.
This method is equivalent to forEach().exec(function).endFor().
map
in interface ILevel0ArrayOperator<I,T>
map
in interface ExecutableArrayOperator<T>
function
- the function to be executed
public Level0GenericUniqOperator<I,Boolean> all(IFunction<? super T,Boolean> eval)
all
in interface ILevel0ArrayOperator<I,T>
all
in interface TotalizableOperator<I,T>
public Level0GenericUniqOperator<I,Boolean> any(IFunction<? super T,Boolean> eval)
any
in interface ILevel0ArrayOperator<I,T>
any
in interface TotalizableOperator<I,T>
public Level0ArrayOperator<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 ILevel0ArrayOperator<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,T[]> zipAndGroupKeysFrom(Collection<K> keys)
ConvertibleToMapOfArrayOperator
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 arrays.
zipAndGroupKeysFrom
in interface ILevel0ArrayOperator<I,T>
zipAndGroupKeysFrom
in interface ConvertibleToMapOfArrayOperator<T>
K
- the type of the keys that will be createdkeys
- the keys to be zipped
public <K> Level0MapOperator<I,K,T[]> zipAndGroupKeysFrom(K[] keys)
ConvertibleToMapOfArrayOperator
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 arrays.
zipAndGroupKeysFrom
in interface ILevel0ArrayOperator<I,T>
zipAndGroupKeysFrom
in interface ConvertibleToMapOfArrayOperator<T>
K
- the type of the keys that will be createdkeys
- the keys to be zipped
public <V> Level0MapOperator<I,T,V[]> zipAndGroupValuesFrom(org.javaruntype.type.Type<V> valueType, Collection<V> values)
ConvertibleToMapOfArrayOperator
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 arrays.
zipAndGroupValuesFrom
in interface ILevel0ArrayOperator<I,T>
zipAndGroupValuesFrom
in interface ConvertibleToMapOfArrayOperator<T>
V
- the type of the values that will be createdvalueType
- the type of the values, that will be used for instantiating the value arraysvalues
- the values to be zipped
public <V> Level0MapOperator<I,T,V[]> zipAndGroupValuesFrom(org.javaruntype.type.Type<V> valueType, V[] values)
ConvertibleToMapOfArrayOperator
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 arrays.
zipAndGroupValuesFrom
in interface ILevel0ArrayOperator<I,T>
zipAndGroupValuesFrom
in interface ConvertibleToMapOfArrayOperator<T>
V
- the type of the values that will be createdvalueType
- the type of the values, that will be used for instantiating the value arraysvalues
- 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 ILevel0ArrayOperator<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 ILevel0ArrayOperator<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 ILevel0ArrayOperator<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 ILevel0ArrayOperator<I,T>
zipValuesFrom
in interface ConvertibleToMapOperator<T>
V
- the type of the valuesvalues
- the new values
public Level0ArrayOperator<I,T> reverse()
ReversibleOperator
Reverses the elements of the structure.
reverse
in interface ILevel0ArrayOperator<I,T>
reverse
in interface ReversibleOperator<T>
public <K,V> Level0MapOperator<I,K,V[]> toGroupMapOf(org.javaruntype.type.Type<V> valueType, IFunction<? super T,K> keyFunction, IFunction<? super T,V> valueFunction)
ConvertibleToMapOfArrayOperator
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. Values with the same key will be grouped into arrays.
toGroupMapOf
in interface ILevel0ArrayOperator<I,T>
toGroupMapOf
in interface ConvertibleToMapOfArrayOperator<T>
K
- the type of the keys that will be createdV
- the type of the values that will be createdvalueType
- the type of the values, that will be used for instantiating the value arrayskeyFunction
- 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 ILevel0ArrayOperator<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 Level0ArrayOperator<I,T> execIfFalseAsArray(IFunction<? super T[],Boolean> eval, IFunction<? super T[],? extends T[]> function)
ExecutableArrayOperator
Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfFalseAsArray
in interface ILevel0ArrayOperator<I,T>
execIfFalseAsArray
in interface ExecutableArrayOperator<T>
eval
- the evaluation function used to select elementsfunction
- the function to be executed on the selected elements
public <X> Level0ArrayOperator<I,X> execIfFalseAsArrayOf(org.javaruntype.type.Type<X> newType, IFunction<? super T[],Boolean> eval, IFunction<? super T[],X[]> function, IFunction<? super T[],X[]> elseFunction)
ExecutableArrayOperator
Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfFalseAsArrayOf
in interface ILevel0ArrayOperator<I,T>
execIfFalseAsArrayOf
in interface ExecutableArrayOperator<T>
X
- the new type returned by the functionsnewType
- 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 Level0ArrayOperator<I,T> execIfNotNullAsArray(IFunction<? super T[],? extends T[]> function)
ExecutableArrayOperator
Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfNotNullAsArray
in interface ILevel0ArrayOperator<I,T>
execIfNotNullAsArray
in interface ExecutableArrayOperator<T>
function
- the function to be executed on the selected elements
public <X> Level0ArrayOperator<I,X> execIfNotNullAsArrayOf(org.javaruntype.type.Type<X> newType, IFunction<? super T[],X[]> function, IFunction<? super T[],X[]> elseFunction)
ExecutableArrayOperator
Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfNotNullAsArrayOf
in interface ILevel0ArrayOperator<I,T>
execIfNotNullAsArrayOf
in interface ExecutableArrayOperator<T>
X
- the new type returned by the functionsnewType
- 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 Level0ArrayOperator<I,T> execIfNullAsArray(IFunction<? super T[],? extends T[]> function)
ExecutableArrayOperator
Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfNullAsArray
in interface ILevel0ArrayOperator<I,T>
execIfNullAsArray
in interface ExecutableArrayOperator<T>
function
- the function to be executed on the selected elements
public <X> Level0ArrayOperator<I,X> execIfNullAsArrayOf(org.javaruntype.type.Type<X> newType, IFunction<? super T[],X[]> function, IFunction<? super T[],X[]> elseFunction)
ExecutableArrayOperator
Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfNullAsArrayOf
in interface ILevel0ArrayOperator<I,T>
execIfNullAsArrayOf
in interface ExecutableArrayOperator<T>
X
- the new type returned by the functionsnewType
- 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 Level0ArrayOperator<I,T> execIfTrueAsArray(IFunction<? super T[],Boolean> eval, IFunction<? super T[],? extends T[]> function)
ExecutableArrayOperator
Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfTrueAsArray
in interface ILevel0ArrayOperator<I,T>
execIfTrueAsArray
in interface ExecutableArrayOperator<T>
eval
- the evaluation function used to select elementsfunction
- the function to be executed on the selected elements
public <X> Level0ArrayOperator<I,X> execIfTrueAsArrayOf(org.javaruntype.type.Type<X> newType, IFunction<? super T[],Boolean> eval, IFunction<? super T[],X[]> function, IFunction<? super T[],X[]> elseFunction)
ExecutableArrayOperator
Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfTrueAsArrayOf
in interface ILevel0ArrayOperator<I,T>
execIfTrueAsArrayOf
in interface ExecutableArrayOperator<T>
X
- the new type returned by the functionsnewType
- 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 Level0ArrayOperator<I,T> mapIfFalse(IFunction<? super T,Boolean> eval, IFunction<? super T,? extends T> function)
ExecutableArrayOperator
Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction)
but only
on selected elements, leaving all other elements untouched.
mapIfFalse
in interface ILevel0ArrayOperator<I,T>
mapIfFalse
in interface ExecutableArrayOperator<T>
eval
- the evaluation function used to select elementsfunction
- the function to be executed on the selected elements
public <X> Level0ArrayOperator<I,X> mapIfFalse(org.javaruntype.type.Type<X> newType, IFunction<? super T,Boolean> eval, IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
ExecutableArrayOperator
Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction)
but only
on selected elements, leaving all other elements untouched.
mapIfFalse
in interface ILevel0ArrayOperator<I,T>
mapIfFalse
in interface ExecutableArrayOperator<T>
X
- the new type returned by the functionsnewType
- 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 Level0ArrayOperator<I,T> mapIfNotNull(IFunction<? super T,? extends T> function)
ExecutableArrayOperator
Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction)
but only
on selected elements, leaving all other elements untouched.
mapIfNotNull
in interface ILevel0ArrayOperator<I,T>
mapIfNotNull
in interface ExecutableArrayOperator<T>
function
- the function to be executed on the selected elements
public <X> Level0ArrayOperator<I,X> mapIfNotNull(org.javaruntype.type.Type<X> newType, IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
ExecutableArrayOperator
Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction)
but only
on selected elements, leaving all other elements untouched.
mapIfNotNull
in interface ILevel0ArrayOperator<I,T>
mapIfNotNull
in interface ExecutableArrayOperator<T>
X
- the new type returned by the functionsnewType
- 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 Level0ArrayOperator<I,T> mapIfNull(IFunction<? super T,? extends T> function)
ExecutableArrayOperator
Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction)
but only
on selected elements, leaving all other elements untouched.
mapIfNull
in interface ILevel0ArrayOperator<I,T>
mapIfNull
in interface ExecutableArrayOperator<T>
function
- the function to be executed on the selected elements
public <X> Level0ArrayOperator<I,X> mapIfNull(org.javaruntype.type.Type<X> newType, IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
ExecutableArrayOperator
Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction)
but only
on selected elements, leaving all other elements untouched.
mapIfNull
in interface ILevel0ArrayOperator<I,T>
mapIfNull
in interface ExecutableArrayOperator<T>
X
- the new type returned by the functionsnewType
- 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 Level0ArrayOperator<I,T> mapIfTrue(IFunction<? super T,Boolean> eval, IFunction<? super T,? extends T> function)
ExecutableArrayOperator
Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction)
but only
on selected elements, leaving all other elements untouched.
mapIfTrue
in interface ILevel0ArrayOperator<I,T>
mapIfTrue
in interface ExecutableArrayOperator<T>
eval
- the evaluation function used to select elementsfunction
- the function to be executed on the selected elements
public <X> Level0ArrayOperator<I,X> mapIfTrue(org.javaruntype.type.Type<X> newType, IFunction<? super T,Boolean> eval, IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
ExecutableArrayOperator
Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction)
but only
on selected elements, leaving all other elements untouched.
mapIfTrue
in interface ILevel0ArrayOperator<I,T>
mapIfTrue
in interface ExecutableArrayOperator<T>
X
- the new type returned by the functionsnewType
- 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 |