org.op4j.operators.impl.fn.array
Class Level0ArrayOperator<I,T>

Object
  extended by org.op4j.operators.impl.AbstractOperator
      extended by org.op4j.operators.impl.fn.array.Level0ArrayOperator<I,T>
All Implemented Interfaces:
ILevel0ArrayOperator<I,T>, CastableToArrayOperator, ConvertibleToListOperator, ConvertibleToMapOfArrayOperator<T>, ConvertibleToMapOperator<T>, ConvertibleToSetOperator, DistinguishableOperator, ExecutableArrayOperator<T>, GenerizableOperator<I,T[]>, ModifiableCollectionOperator<T>, NavigableCollectionOperator<T>, Operator, ReplaceableIfNullOperator<T[]>, ReplaceableOperator<T[]>, ReversibleOperator<T>, SelectableOperator<T[]>, SortableOperator<T>, TotalizableOperator<I,T>, UniqFnOperator<I,T[]>, UniqOperator<T[]>

public final class Level0ArrayOperator<I,T>
extends AbstractOperator
implements UniqFnOperator<I,T[]>, ILevel0ArrayOperator<I,T>

Since:
1.0
Author:
Daniel Fernández

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)
           
<X> Level0ArrayOperator<I,X>
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.
<X> Level0GenericUniqOperator<I,X>
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.
<X> Level0ArrayOperator<I,X>
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.
<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)
           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.
<X> Level0ArrayOperator<I,X>
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.
<X> Level0ArrayOperator<I,X>
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.
<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)
           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.
<X> Level0ArrayOperator<I,X>
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.
<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)
           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.
<X> Level0ArrayOperator<I,X>
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.
<X> Level0ArrayOperator<I,X>
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.
<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)
           Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction) but only on selected elements, leaving all other elements untouched.
<X> Level0ArrayOperator<I,X>
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.
<K,V> Level0MapOperator<I,K,V[]>
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.
<K,V> Level0MapOperator<I,K,V[]>
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.
<K,V> Level0MapOperator<I,K,V>
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.
<K,V> Level0MapOperator<I,K,V>
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.
<K> Level0MapOperator<I,K,T[]>
zipAndGroupKeys(K... keys)
           Converts the target object to a map by using the original target's elements as values the specified objects as keys.
<K> Level0MapOperator<I,K,T[]>
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.
<K> Level0MapOperator<I,K,T[]>
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.
<K> Level0MapOperator<I,K,T[]>
zipAndGroupKeysFrom(K[] keys)
           Converts the target object to a map by using the original target's elements as values the specified objects as keys.
<V> Level0MapOperator<I,T,V[]>
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.
<V> Level0MapOperator<I,T,V[]>
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.
<V> Level0MapOperator<I,T,V[]>
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.
<V> Level0MapOperator<I,T,V[]>
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.
<K> Level0MapOperator<I,K,T>
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.
<K> Level0MapOperator<I,K,T>
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.
<K> Level0MapOperator<I,K,T>
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.
<K> Level0MapOperator<I,K,T>
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.
<V> Level0MapOperator<I,T,V>
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.
<V> Level0MapOperator<I,T,V>
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.
<V> Level0MapOperator<I,T,V>
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.
<V> Level0MapOperator<I,T,V>
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

Level0ArrayOperator

public Level0ArrayOperator(org.javaruntype.type.Type<T> type,
                           Target target)
Method Detail

add

public Level0ArrayOperator<I,T> add(T newElement)
Description copied from interface: ModifiableCollectionOperator

Adds the specified element at the end of the target structure object.

The original target object is not modified, but copied instead.

Specified by:
add in interface ILevel0ArrayOperator<I,T>
Specified by:
add in interface ModifiableCollectionOperator<T>
Parameters:
newElement - the element to be added
Returns:
an operator holding the modified target object

addAll

public Level0ArrayOperator<I,T> addAll(T... newElements)
Description copied from interface: ModifiableCollectionOperator

Adds all the specified elements at the end of the target structure object.

The original target object is not modified, but copied instead.

Specified by:
addAll in interface ILevel0ArrayOperator<I,T>
Specified by:
addAll in interface ModifiableCollectionOperator<T>
Parameters:
newElements - the elements to be added
Returns:
an operator holding the modified target object

insert

public Level0ArrayOperator<I,T> insert(int position,
                                       T newElement)
Description copied from interface: 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.

Specified by:
insert in interface ILevel0ArrayOperator<I,T>
Specified by:
insert in interface ModifiableCollectionOperator<T>
Parameters:
position - the position in which the new element will be inserted (starting in 0)
newElement - the element to be inserted
Returns:
an operator holding the modified target object

insertAll

public Level0ArrayOperator<I,T> insertAll(int position,
                                          T... newElements)
Description copied from interface: 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.

Specified by:
insertAll in interface ILevel0ArrayOperator<I,T>
Specified by:
insertAll in interface ModifiableCollectionOperator<T>
Parameters:
position - the position in which the new element will be inserted (starting in 0)
newElements - the elements to be inserted
Returns:
an operator holding the modified target object

addAll

public Level0ArrayOperator<I,T> addAll(Collection<T> collection)
Description copied from interface: ModifiableCollectionOperator

Adds all the elements in the specified collection to the target structure object.

The original target object is not modified, but copied instead.

Specified by:
addAll in interface ILevel0ArrayOperator<I,T>
Specified by:
addAll in interface ModifiableCollectionOperator<T>
Parameters:
collection - the collection containing the elements to be added
Returns:
an operator holding the modified target object

distinct

public Level0ArrayOperator<I,T> distinct()
Description copied from interface: DistinguishableOperator

Removes all duplicate elements from the target collection or array.

Specified by:
distinct in interface ILevel0ArrayOperator<I,T>
Specified by:
distinct in interface DistinguishableOperator
Returns:
an operator with the resulting target collection or array.

forEach

public Level1ArrayElementsOperator<I,T> forEach()
Description copied from interface: 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.

Specified by:
forEach in interface ILevel0ArrayOperator<I,T>
Specified by:
forEach in interface NavigableCollectionOperator<T>
Returns:
an operator which will execute all operations on each element of the collection.

removeAllIndexes

public Level0ArrayOperator<I,T> removeAllIndexes(int... indexes)
Description copied from interface: 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.

Specified by:
removeAllIndexes in interface ILevel0ArrayOperator<I,T>
Specified by:
removeAllIndexes in interface ModifiableCollectionOperator<T>
Parameters:
indexes - the positions of the elements to be removed
Returns:
an operator holding the modified target object

removeAllEqual

public Level0ArrayOperator<I,T> removeAllEqual(T... values)
Description copied from interface: ModifiableCollectionOperator

Removes the specified values from the target structure object.

The original target object is not modified, but copied instead.

Specified by:
removeAllEqual in interface ILevel0ArrayOperator<I,T>
Specified by:
removeAllEqual in interface ModifiableCollectionOperator<T>
Parameters:
values - the values to be removed from the target.
Returns:
an operator holding the modified target object

removeAllTrue

public Level0ArrayOperator<I,T> removeAllTrue(IFunction<? super T,Boolean> eval)
Description copied from interface: 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.

Specified by:
removeAllTrue in interface ILevel0ArrayOperator<I,T>
Specified by:
removeAllTrue in interface ModifiableCollectionOperator<T>
Parameters:
eval - the evaluator to be used, which must return Boolean
Returns:
an operator holding the modified target object

removeAllFalse

public Level0ArrayOperator<I,T> removeAllFalse(IFunction<? super T,Boolean> eval)
Description copied from interface: 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.

Specified by:
removeAllFalse in interface ILevel0ArrayOperator<I,T>
Specified by:
removeAllFalse in interface ModifiableCollectionOperator<T>
Parameters:
eval - the evaluator to be used, which must return Boolean
Returns:
an operator holding the modified target object

removeAllNullOrFalse

public Level0ArrayOperator<I,T> removeAllNullOrFalse(IFunction<? super T,Boolean> eval)
Description copied from interface: 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.

Specified by:
removeAllNullOrFalse in interface ILevel0ArrayOperator<I,T>
Specified by:
removeAllNullOrFalse in interface ModifiableCollectionOperator<T>
Parameters:
eval - the evaluator to be used, which must return Boolean
Returns:
an operator holding the modified target object

removeAllNotNullAndFalse

public Level0ArrayOperator<I,T> removeAllNotNullAndFalse(IFunction<? super T,Boolean> eval)
Description copied from interface: 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.

Specified by:
removeAllNotNullAndFalse in interface ILevel0ArrayOperator<I,T>
Specified by:
removeAllNotNullAndFalse in interface ModifiableCollectionOperator<T>
Parameters:
eval - the evaluator to be used, which must return Boolean
Returns:
an operator holding the modified target object

removeAllNullOrTrue

public Level0ArrayOperator<I,T> removeAllNullOrTrue(IFunction<? super T,Boolean> eval)
Description copied from interface: 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.

Specified by:
removeAllNullOrTrue in interface ILevel0ArrayOperator<I,T>
Specified by:
removeAllNullOrTrue in interface ModifiableCollectionOperator<T>
Parameters:
eval - the evaluator to be used, which must return Boolean
Returns:
an operator holding the modified target object

removeAllNotNullAndTrue

public Level0ArrayOperator<I,T> removeAllNotNullAndTrue(IFunction<? super T,Boolean> eval)
Description copied from interface: 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.

Specified by:
removeAllNotNullAndTrue in interface ILevel0ArrayOperator<I,T>
Specified by:
removeAllNotNullAndTrue in interface ModifiableCollectionOperator<T>
Parameters:
eval - the evaluator to be used, which must return Boolean
Returns:
an operator holding the modified target object

removeAllIndexesNot

public Level0ArrayOperator<I,T> removeAllIndexesNot(int... indexes)
Description copied from interface: 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.

Specified by:
removeAllIndexesNot in interface ILevel0ArrayOperator<I,T>
Specified by:
removeAllIndexesNot in interface ModifiableCollectionOperator<T>
Parameters:
indexes - the positions of the elements to be kept
Returns:
an operator holding the modified target object

removeAllNull

public Level0ArrayOperator<I,T> removeAllNull()
Description copied from interface: ModifiableCollectionOperator

Remove all the null elements in the target structure object.

The original target object is not modified, but copied instead.

Specified by:
removeAllNull in interface ILevel0ArrayOperator<I,T>
Specified by:
removeAllNull in interface ModifiableCollectionOperator<T>
Returns:
an operator holding the modified target object

sort

public Level0ArrayOperator<I,T> sort()
Description copied from interface: SortableOperator

Sorts the elements of the structure according to their natural ordering.

Specified by:
sort in interface ILevel0ArrayOperator<I,T>
Specified by:
sort in interface SortableOperator<T>
Returns:
an operator containing the sorted structure as target object.

sort

public Level0ArrayOperator<I,T> sort(Comparator<? super T> comparator)
Description copied from interface: SortableOperator

Sorts the elements of the structure according to the order induced by the specified comparator.

Specified by:
sort in interface ILevel0ArrayOperator<I,T>
Specified by:
sort in interface SortableOperator<T>
Parameters:
comparator - the comparator to be used.
Returns:
an operator containing the sorted structure as target object.

toList

public Level0ListOperator<I,T> toList()
Description copied from interface: ConvertibleToListOperator

Converts the current target to a list.

Specified by:
toList in interface ILevel0ArrayOperator<I,T>
Specified by:
toList in interface ConvertibleToListOperator
Returns:
an operator holding the converted object as target.

couple

public Level0MapOperator<I,T,T> couple()
Description copied from interface: ConvertibleToMapOperator

Converts the target object to a map, by using the even elements (starting at 0) as keys, and the odd elements as values.

Specified by:
couple in interface ILevel0ArrayOperator<I,T>
Specified by:
couple in interface ConvertibleToMapOperator<T>
Returns:
an operator holding the converted object as target.

coupleAndGroup

public Level0MapOperator<I,T,T[]> coupleAndGroup()
Description copied from interface: 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.

Specified by:
coupleAndGroup in interface ILevel0ArrayOperator<I,T>
Specified by:
coupleAndGroup in interface ConvertibleToMapOfArrayOperator<T>
Returns:
an operator holding the converted object as target.

zipKeysBy

public <K> Level0MapOperator<I,K,T> zipKeysBy(IFunction<? super T,K> keyEval)
Description copied from interface: 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).

Specified by:
zipKeysBy in interface ILevel0ArrayOperator<I,T>
Specified by:
zipKeysBy in interface ConvertibleToMapOperator<T>
Type Parameters:
K - the type of the keys that will be created
Parameters:
keyEval - the evaluator used for obtaining the keys
Returns:
an operator holding the converted object as target.

zipValuesBy

public <V> Level0MapOperator<I,T,V> zipValuesBy(IFunction<? super T,V> valueEval)
Description copied from interface: 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).

Specified by:
zipValuesBy in interface ILevel0ArrayOperator<I,T>
Specified by:
zipValuesBy in interface ConvertibleToMapOperator<T>
Type Parameters:
V - the type of the values that will be created
Parameters:
valueEval - the evaluator used for obtaining the values
Returns:
an operator holding the converted object as target.

zipKeys

public <K> Level0MapOperator<I,K,T> zipKeys(K... keys)
Description copied from interface: 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).

Specified by:
zipKeys in interface ILevel0ArrayOperator<I,T>
Specified by:
zipKeys in interface ConvertibleToMapOperator<T>
Type Parameters:
K - the type of the keys
Parameters:
keys - the new keys
Returns:
an operator holding the converted object as target.

zipValues

public <V> Level0MapOperator<I,T,V> zipValues(V... values)
Description copied from interface: 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.

Specified by:
zipValues in interface ILevel0ArrayOperator<I,T>
Specified by:
zipValues in interface ConvertibleToMapOperator<T>
Type Parameters:
V - the type of the values
Parameters:
values - the new values
Returns:
an operator holding the converted object as target.

zipAndGroupKeysBy

public <K> Level0MapOperator<I,K,T[]> zipAndGroupKeysBy(IFunction<? super T,K> keyEval)
Description copied from interface: 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.

Specified by:
zipAndGroupKeysBy in interface ILevel0ArrayOperator<I,T>
Specified by:
zipAndGroupKeysBy in interface ConvertibleToMapOfArrayOperator<T>
Type Parameters:
K - the type of the keys that will be created
Parameters:
keyEval - the evaluator used for obtaining the keys
Returns:
an operator holding the converted object as target.

zipAndGroupValuesBy

public <V> Level0MapOperator<I,T,V[]> zipAndGroupValuesBy(org.javaruntype.type.Type<V> valueType,
                                                          IFunction<? super T,V> valueEval)
Description copied from interface: 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.

Specified by:
zipAndGroupValuesBy in interface ILevel0ArrayOperator<I,T>
Specified by:
zipAndGroupValuesBy in interface ConvertibleToMapOfArrayOperator<T>
Type Parameters:
V - the type of the values that will be created
Parameters:
valueType - the type of the values, that will be used for instantiating the value arrays
valueEval - the evaluator used for obtaining the values
Returns:
an operator holding the converted object as target.

zipAndGroupKeys

public <K> Level0MapOperator<I,K,T[]> zipAndGroupKeys(K... keys)
Description copied from interface: 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.

Specified by:
zipAndGroupKeys in interface ILevel0ArrayOperator<I,T>
Specified by:
zipAndGroupKeys in interface ConvertibleToMapOfArrayOperator<T>
Type Parameters:
K - the type of the keys that will be created
Parameters:
keys - the keys to be zipped
Returns:
an operator holding the converted object as target.

zipAndGroupValues

public <V> Level0MapOperator<I,T,V[]> zipAndGroupValues(org.javaruntype.type.Type<V> valueType,
                                                        V... values)
Description copied from interface: 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.

Specified by:
zipAndGroupValues in interface ILevel0ArrayOperator<I,T>
Specified by:
zipAndGroupValues in interface ConvertibleToMapOfArrayOperator<T>
Type Parameters:
V - the type of the values that will be created
Parameters:
valueType - the type of the values, that will be used for instantiating the value arrays
values - the values to be zipped
Returns:
an operator holding the converted object as target.

toMap

public <K,V> Level0MapOperator<I,K,V> toMap(IFunction<? super T,Map.Entry<K,V>> mapBuilder)
Description copied from interface: 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).

Specified by:
toMap in interface ILevel0ArrayOperator<I,T>
Specified by:
toMap in interface ConvertibleToMapOperator<T>
Type Parameters:
K - the type of the keys that will be created
V - the type of the values that will be created
Parameters:
mapBuilder - the map builder function to be used
Returns:
an operator holding the converted object as target.

toGroupMapOf

public <K,V> Level0MapOperator<I,K,V[]> toGroupMapOf(org.javaruntype.type.Type<V> valueType,
                                                     IFunction<? super T,Map.Entry<K,V>> mapBuilder)
Description copied from interface: 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.

Specified by:
toGroupMapOf in interface ILevel0ArrayOperator<I,T>
Specified by:
toGroupMapOf in interface ConvertibleToMapOfArrayOperator<T>
Type Parameters:
K - the type of the keys that will be created
V - the type of the values that will be created
Parameters:
valueType - the type of the values, that will be used for instantiating the value arrays
mapBuilder - the map builder function to be used
Returns:
an operator holding the converted object as target.

toSet

public Level0SetOperator<I,T> toSet()
Description copied from interface: ConvertibleToSetOperator

Converts the current target into a set.

Specified by:
toSet in interface ILevel0ArrayOperator<I,T>
Specified by:
toSet in interface ConvertibleToSetOperator
Returns:
an operator holding the converted object as target.

get

public Function<I,T[]> get()
Description copied from interface: UniqFnOperator

Returns a function which will execute all the logic specified from the "Fn.on" expression.

Specified by:
get in interface UniqFnOperator<I,T[]>
Returns:
the function.

generic

public Level0GenericUniqOperator<I,T[]> generic()
Description copied from interface: GenerizableOperator

Converts the specialized structure operator into generic operators (with no specific methods for structures - e.g. forEach())

Specified by:
generic in interface ILevel0ArrayOperator<I,T>
Specified by:
generic in interface GenerizableOperator<I,T[]>
Returns:
a generic operator on the same target object

of

public <X> Level0ArrayOperator<I,X> of(org.javaruntype.type.Type<X> newType)
Description copied from interface: CastableToArrayOperator

Casts the operator's target as an array of the specified type.

Specified by:
of in interface ILevel0ArrayOperator<I,T>
Specified by:
of in interface CastableToArrayOperator
Type Parameters:
X - the type of the elements of the array
Parameters:
newType - the type of the elements of the array
Returns:
the resulting casted operator

castToArrayOf

public <X> Level0ArrayOperator<I,X> castToArrayOf(org.javaruntype.type.Type<X> newType)
Description copied from interface: CastableToArrayOperator

Casts the operator's target as an array of the specified type.

Specified by:
castToArrayOf in interface ILevel0ArrayOperator<I,T>
Specified by:
castToArrayOf in interface CastableToArrayOperator
Type Parameters:
X - the type of the elements of the array
Parameters:
newType - the type of the elements of the array
Returns:
the resulting casted operator

ifTrue

public Level0ArraySelectedOperator<I,T> ifTrue(IFunction<? super T[],Boolean> eval)
Description copied from interface: 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.

Specified by:
ifTrue in interface ILevel0ArrayOperator<I,T>
Specified by:
ifTrue in interface SelectableOperator<T[]>
Parameters:
eval - the evaluator to be used for selecting targets.
Returns:
an operator which will execute all subsequent operations only on the selected target objects.

ifFalse

public Level0ArraySelectedOperator<I,T> ifFalse(IFunction<? super T[],Boolean> eval)
Description copied from interface: 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.

Specified by:
ifFalse in interface ILevel0ArrayOperator<I,T>
Specified by:
ifFalse in interface SelectableOperator<T[]>
Parameters:
eval - the evaluator to be used for selecting targets.
Returns:
an operator which will execute all subsequent operations only on the selected target objects.

ifNotNull

public Level0ArraySelectedOperator<I,T> ifNotNull()
Description copied from interface: 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.

Specified by:
ifNotNull in interface ILevel0ArrayOperator<I,T>
Specified by:
ifNotNull in interface SelectableOperator<T[]>
Returns:
an operator which will execute all subsequent operations only on the selected target objects.

ifNull

public Level0ArraySelectedOperator<I,T> ifNull()
Description copied from interface: 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.

Specified by:
ifNull in interface ILevel0ArrayOperator<I,T>
Specified by:
ifNull in interface SelectableOperator<T[]>
Returns:
an operator which will execute all subsequent operations only on the selected target objects.

execAsArray

public Level0ArrayOperator<I,T> execAsArray(IFunction<? super T[],? extends T[]> function)
Description copied from interface: 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.

Specified by:
execAsArray in interface ILevel0ArrayOperator<I,T>
Specified by:
execAsArray in interface ExecutableArrayOperator<T>
Parameters:
function - the function to be executed
Returns:
an operator on the results of function execution

execAsArrayOf

public <X> Level0ArrayOperator<I,X> execAsArrayOf(org.javaruntype.type.Type<X> newType,
                                                  IFunction<? super T[],X[]> function)
Description copied from interface: 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.

Specified by:
execAsArrayOf in interface ILevel0ArrayOperator<I,T>
Specified by:
execAsArrayOf in interface ExecutableArrayOperator<T>
Type Parameters:
X - the type of the result elements
Parameters:
newType - the new type for the operator
function - the function to be executed
Returns:
an operator on the results of function execution

exec

public <X> Level0GenericUniqOperator<I,X> exec(IFunction<? super T[],X> function)
Description copied from interface: 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.

Specified by:
exec in interface ILevel0ArrayOperator<I,T>
Specified by:
exec in interface ExecutableArrayOperator<T>
Type Parameters:
X - the type of the result object
Parameters:
function - the function to be executed
Returns:
an operator on the results of function execution

replaceWith

public Level0ArrayOperator<I,T> replaceWith(T[] replacement)
Description copied from interface: ReplaceableOperator

Replaces the current target object with the specified replacement.

Specified by:
replaceWith in interface ILevel0ArrayOperator<I,T>
Specified by:
replaceWith in interface ReplaceableOperator<T[]>
Parameters:
replacement - the object which will replace the current target object.
Returns:
an operator containing the replacement object as target.

replaceIfNullWith

public Level0ArrayOperator<I,T> replaceIfNullWith(T[] replacement)
Description copied from interface: ReplaceableIfNullOperator

Replaces the current target object with the specified replacement if the current target is null.

Specified by:
replaceIfNullWith in interface ILevel0ArrayOperator<I,T>
Specified by:
replaceIfNullWith in interface ReplaceableIfNullOperator<T[]>
Parameters:
replacement - the object which will replace the current target object if target is null.
Returns:
an operator containing the original target object if it was not null, or the new one if null.

map

public <X> Level0ArrayOperator<I,X> map(org.javaruntype.type.Type<X> newType,
                                        IFunction<? super T,X> function)
Description copied from interface: 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().

Specified by:
map in interface ILevel0ArrayOperator<I,T>
Specified by:
map in interface ExecutableArrayOperator<T>
Type Parameters:
X - the type of the result elements
Parameters:
newType - the new type for the operator
function - the function to be executed
Returns:
an operator on the results of function execution on each element

map

public Level0ArrayOperator<I,T> map(IFunction<? super T,? extends T> function)
Description copied from interface: 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().

Specified by:
map in interface ILevel0ArrayOperator<I,T>
Specified by:
map in interface ExecutableArrayOperator<T>
Parameters:
function - the function to be executed
Returns:
an operator on the results of function execution on each element

all

public Level0GenericUniqOperator<I,Boolean> all(IFunction<? super T,Boolean> eval)
Specified by:
all in interface ILevel0ArrayOperator<I,T>
Specified by:
all in interface TotalizableOperator<I,T>

any

public Level0GenericUniqOperator<I,Boolean> any(IFunction<? super T,Boolean> eval)
Specified by:
any in interface ILevel0ArrayOperator<I,T>
Specified by:
any in interface TotalizableOperator<I,T>

sortBy

public Level0ArrayOperator<I,T> sortBy(IFunction<? super T,?> by)
Description copied from interface: SortableOperator

Sorts the elements of the structure according to the result of executing the specified function.

Specified by:
sortBy in interface ILevel0ArrayOperator<I,T>
Specified by:
sortBy in interface SortableOperator<T>
Parameters:
by - the function to be executed in order to obtain the compared object
Returns:
an operator containing the sorted structure as target object.

zipAndGroupKeysFrom

public <K> Level0MapOperator<I,K,T[]> zipAndGroupKeysFrom(Collection<K> keys)
Description copied from interface: 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.

Specified by:
zipAndGroupKeysFrom in interface ILevel0ArrayOperator<I,T>
Specified by:
zipAndGroupKeysFrom in interface ConvertibleToMapOfArrayOperator<T>
Type Parameters:
K - the type of the keys that will be created
Parameters:
keys - the keys to be zipped
Returns:
an operator holding the converted object as target.

zipAndGroupKeysFrom

public <K> Level0MapOperator<I,K,T[]> zipAndGroupKeysFrom(K[] keys)
Description copied from interface: 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.

Specified by:
zipAndGroupKeysFrom in interface ILevel0ArrayOperator<I,T>
Specified by:
zipAndGroupKeysFrom in interface ConvertibleToMapOfArrayOperator<T>
Type Parameters:
K - the type of the keys that will be created
Parameters:
keys - the keys to be zipped
Returns:
an operator holding the converted object as target.

zipAndGroupValuesFrom

public <V> Level0MapOperator<I,T,V[]> zipAndGroupValuesFrom(org.javaruntype.type.Type<V> valueType,
                                                            Collection<V> values)
Description copied from interface: 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.

Specified by:
zipAndGroupValuesFrom in interface ILevel0ArrayOperator<I,T>
Specified by:
zipAndGroupValuesFrom in interface ConvertibleToMapOfArrayOperator<T>
Type Parameters:
V - the type of the values that will be created
Parameters:
valueType - the type of the values, that will be used for instantiating the value arrays
values - the values to be zipped
Returns:
an operator holding the converted object as target.

zipAndGroupValuesFrom

public <V> Level0MapOperator<I,T,V[]> zipAndGroupValuesFrom(org.javaruntype.type.Type<V> valueType,
                                                            V[] values)
Description copied from interface: 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.

Specified by:
zipAndGroupValuesFrom in interface ILevel0ArrayOperator<I,T>
Specified by:
zipAndGroupValuesFrom in interface ConvertibleToMapOfArrayOperator<T>
Type Parameters:
V - the type of the values that will be created
Parameters:
valueType - the type of the values, that will be used for instantiating the value arrays
values - the values to be zipped
Returns:
an operator holding the converted object as target.

zipKeysFrom

public <K> Level0MapOperator<I,K,T> zipKeysFrom(Collection<K> keys)
Description copied from interface: 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).

Specified by:
zipKeysFrom in interface ILevel0ArrayOperator<I,T>
Specified by:
zipKeysFrom in interface ConvertibleToMapOperator<T>
Type Parameters:
K - the type of the keys
Parameters:
keys - the new keys
Returns:
an operator holding the converted object as target.

zipKeysFrom

public <K> Level0MapOperator<I,K,T> zipKeysFrom(K[] keys)
Description copied from interface: 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).

Specified by:
zipKeysFrom in interface ILevel0ArrayOperator<I,T>
Specified by:
zipKeysFrom in interface ConvertibleToMapOperator<T>
Type Parameters:
K - the type of the keys
Parameters:
keys - the new keys
Returns:
an operator holding the converted object as target.

zipValuesFrom

public <V> Level0MapOperator<I,T,V> zipValuesFrom(Collection<V> values)
Description copied from interface: 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.

Specified by:
zipValuesFrom in interface ILevel0ArrayOperator<I,T>
Specified by:
zipValuesFrom in interface ConvertibleToMapOperator<T>
Type Parameters:
V - the type of the values
Parameters:
values - the new values
Returns:
an operator holding the converted object as target.

zipValuesFrom

public <V> Level0MapOperator<I,T,V> zipValuesFrom(V[] values)
Description copied from interface: 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.

Specified by:
zipValuesFrom in interface ILevel0ArrayOperator<I,T>
Specified by:
zipValuesFrom in interface ConvertibleToMapOperator<T>
Type Parameters:
V - the type of the values
Parameters:
values - the new values
Returns:
an operator holding the converted object as target.

reverse

public Level0ArrayOperator<I,T> reverse()
Description copied from interface: ReversibleOperator

Reverses the elements of the structure.

Specified by:
reverse in interface ILevel0ArrayOperator<I,T>
Specified by:
reverse in interface ReversibleOperator<T>
Returns:
an operator containing the reversed structure as target object.

toGroupMapOf

public <K,V> Level0MapOperator<I,K,V[]> toGroupMapOf(org.javaruntype.type.Type<V> valueType,
                                                     IFunction<? super T,K> keyFunction,
                                                     IFunction<? super T,V> valueFunction)
Description copied from interface: 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.

Specified by:
toGroupMapOf in interface ILevel0ArrayOperator<I,T>
Specified by:
toGroupMapOf in interface ConvertibleToMapOfArrayOperator<T>
Type Parameters:
K - the type of the keys that will be created
V - the type of the values that will be created
Parameters:
valueType - the type of the values, that will be used for instantiating the value arrays
keyFunction - the function for building the keys
valueFunction - the function for building the values
Returns:
an operator holding the converted object as target.

toMap

public <K,V> Level0MapOperator<I,K,V> toMap(IFunction<? super T,K> keyFunction,
                                            IFunction<? super T,V> valueFunction)
Description copied from interface: 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).

Specified by:
toMap in interface ILevel0ArrayOperator<I,T>
Specified by:
toMap in interface ConvertibleToMapOperator<T>
Type Parameters:
K - the type of the keys that will be created
V - the type of the values that will be created
Parameters:
keyFunction - the function for building the keys
valueFunction - the function for building the values
Returns:
an operator holding the converted object as target.

execIfFalseAsArray

public Level0ArrayOperator<I,T> execIfFalseAsArray(IFunction<? super T[],Boolean> eval,
                                                   IFunction<? super T[],? extends T[]> function)
Description copied from interface: ExecutableArrayOperator

Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction) but only on selected elements, leaving all other elements untouched.

Specified by:
execIfFalseAsArray in interface ILevel0ArrayOperator<I,T>
Specified by:
execIfFalseAsArray in interface ExecutableArrayOperator<T>
Parameters:
eval - the evaluation function used to select elements
function - the function to be executed on the selected elements
Returns:
an operator on the results of function execution

execIfFalseAsArrayOf

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)
Description copied from interface: ExecutableArrayOperator

Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction) but only on selected elements, leaving all other elements untouched.

Specified by:
execIfFalseAsArrayOf in interface ILevel0ArrayOperator<I,T>
Specified by:
execIfFalseAsArrayOf in interface ExecutableArrayOperator<T>
Type Parameters:
X - the new type returned by the functions
Parameters:
newType - the new type returned by the functions
eval - the evaluation function used to select elements
function - the function to be executed on the selected elements
elseFunction - the function to be executed on the non-selected elements
Returns:
an operator on the results of function execution

execIfNotNullAsArray

public Level0ArrayOperator<I,T> execIfNotNullAsArray(IFunction<? super T[],? extends T[]> function)
Description copied from interface: ExecutableArrayOperator

Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction) but only on selected elements, leaving all other elements untouched.

Specified by:
execIfNotNullAsArray in interface ILevel0ArrayOperator<I,T>
Specified by:
execIfNotNullAsArray in interface ExecutableArrayOperator<T>
Parameters:
function - the function to be executed on the selected elements
Returns:
an operator on the results of function execution

execIfNotNullAsArrayOf

public <X> Level0ArrayOperator<I,X> execIfNotNullAsArrayOf(org.javaruntype.type.Type<X> newType,
                                                           IFunction<? super T[],X[]> function,
                                                           IFunction<? super T[],X[]> elseFunction)
Description copied from interface: ExecutableArrayOperator

Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction) but only on selected elements, leaving all other elements untouched.

Specified by:
execIfNotNullAsArrayOf in interface ILevel0ArrayOperator<I,T>
Specified by:
execIfNotNullAsArrayOf in interface ExecutableArrayOperator<T>
Type Parameters:
X - the new type returned by the functions
Parameters:
newType - the new type returned by the functions
function - the function to be executed on the selected elements
elseFunction - the function to be executed on the non-selected elements
Returns:
an operator on the results of function execution

execIfNullAsArray

public Level0ArrayOperator<I,T> execIfNullAsArray(IFunction<? super T[],? extends T[]> function)
Description copied from interface: ExecutableArrayOperator

Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction) but only on selected elements, leaving all other elements untouched.

Specified by:
execIfNullAsArray in interface ILevel0ArrayOperator<I,T>
Specified by:
execIfNullAsArray in interface ExecutableArrayOperator<T>
Parameters:
function - the function to be executed on the selected elements
Returns:
an operator on the results of function execution

execIfNullAsArrayOf

public <X> Level0ArrayOperator<I,X> execIfNullAsArrayOf(org.javaruntype.type.Type<X> newType,
                                                        IFunction<? super T[],X[]> function,
                                                        IFunction<? super T[],X[]> elseFunction)
Description copied from interface: ExecutableArrayOperator

Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction) but only on selected elements, leaving all other elements untouched.

Specified by:
execIfNullAsArrayOf in interface ILevel0ArrayOperator<I,T>
Specified by:
execIfNullAsArrayOf in interface ExecutableArrayOperator<T>
Type Parameters:
X - the new type returned by the functions
Parameters:
newType - the new type returned by the functions
function - the function to be executed on the selected elements
elseFunction - the function to be executed on the non-selected elements
Returns:
an operator on the results of function execution

execIfTrueAsArray

public Level0ArrayOperator<I,T> execIfTrueAsArray(IFunction<? super T[],Boolean> eval,
                                                  IFunction<? super T[],? extends T[]> function)
Description copied from interface: ExecutableArrayOperator

Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction) but only on selected elements, leaving all other elements untouched.

Specified by:
execIfTrueAsArray in interface ILevel0ArrayOperator<I,T>
Specified by:
execIfTrueAsArray in interface ExecutableArrayOperator<T>
Parameters:
eval - the evaluation function used to select elements
function - the function to be executed on the selected elements
Returns:
an operator on the results of function execution

execIfTrueAsArrayOf

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)
Description copied from interface: ExecutableArrayOperator

Executes a function in a way equivalent to ExecutableArrayOperator.execAsArray(IFunction) but only on selected elements, leaving all other elements untouched.

Specified by:
execIfTrueAsArrayOf in interface ILevel0ArrayOperator<I,T>
Specified by:
execIfTrueAsArrayOf in interface ExecutableArrayOperator<T>
Type Parameters:
X - the new type returned by the functions
Parameters:
newType - the new type returned by the functions
eval - the evaluation function used to select elements
function - the function to be executed on the selected elements
elseFunction - the function to be executed on the non-selected elements
Returns:
an operator on the results of function execution

mapIfFalse

public Level0ArrayOperator<I,T> mapIfFalse(IFunction<? super T,Boolean> eval,
                                           IFunction<? super T,? extends T> function)
Description copied from interface: ExecutableArrayOperator

Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction) but only on selected elements, leaving all other elements untouched.

Specified by:
mapIfFalse in interface ILevel0ArrayOperator<I,T>
Specified by:
mapIfFalse in interface ExecutableArrayOperator<T>
Parameters:
eval - the evaluation function used to select elements
function - the function to be executed on the selected elements
Returns:
an operator on the results of function execution

mapIfFalse

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)
Description copied from interface: ExecutableArrayOperator

Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction) but only on selected elements, leaving all other elements untouched.

Specified by:
mapIfFalse in interface ILevel0ArrayOperator<I,T>
Specified by:
mapIfFalse in interface ExecutableArrayOperator<T>
Type Parameters:
X - the new type returned by the functions
Parameters:
newType - the new type returned by the functions
eval - the evaluation function used to select elements
function - the function to be executed on the selected elements
elseFunction - the function to be executed on the non-selected elements
Returns:
an operator on the results of function execution

mapIfNotNull

public Level0ArrayOperator<I,T> mapIfNotNull(IFunction<? super T,? extends T> function)
Description copied from interface: ExecutableArrayOperator

Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction) but only on selected elements, leaving all other elements untouched.

Specified by:
mapIfNotNull in interface ILevel0ArrayOperator<I,T>
Specified by:
mapIfNotNull in interface ExecutableArrayOperator<T>
Parameters:
function - the function to be executed on the selected elements
Returns:
an operator on the results of function execution

mapIfNotNull

public <X> Level0ArrayOperator<I,X> mapIfNotNull(org.javaruntype.type.Type<X> newType,
                                                 IFunction<? super T,X> function,
                                                 IFunction<? super T,X> elseFunction)
Description copied from interface: ExecutableArrayOperator

Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction) but only on selected elements, leaving all other elements untouched.

Specified by:
mapIfNotNull in interface ILevel0ArrayOperator<I,T>
Specified by:
mapIfNotNull in interface ExecutableArrayOperator<T>
Type Parameters:
X - the new type returned by the functions
Parameters:
newType - the new type returned by the functions
function - the function to be executed on the selected elements
elseFunction - the function to be executed on the non-selected elements
Returns:
an operator on the results of function execution

mapIfNull

public Level0ArrayOperator<I,T> mapIfNull(IFunction<? super T,? extends T> function)
Description copied from interface: ExecutableArrayOperator

Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction) but only on selected elements, leaving all other elements untouched.

Specified by:
mapIfNull in interface ILevel0ArrayOperator<I,T>
Specified by:
mapIfNull in interface ExecutableArrayOperator<T>
Parameters:
function - the function to be executed on the selected elements
Returns:
an operator on the results of function execution

mapIfNull

public <X> Level0ArrayOperator<I,X> mapIfNull(org.javaruntype.type.Type<X> newType,
                                              IFunction<? super T,X> function,
                                              IFunction<? super T,X> elseFunction)
Description copied from interface: ExecutableArrayOperator

Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction) but only on selected elements, leaving all other elements untouched.

Specified by:
mapIfNull in interface ILevel0ArrayOperator<I,T>
Specified by:
mapIfNull in interface ExecutableArrayOperator<T>
Type Parameters:
X - the new type returned by the functions
Parameters:
newType - the new type returned by the functions
function - the function to be executed on the selected elements
elseFunction - the function to be executed on the non-selected elements
Returns:
an operator on the results of function execution

mapIfTrue

public Level0ArrayOperator<I,T> mapIfTrue(IFunction<? super T,Boolean> eval,
                                          IFunction<? super T,? extends T> function)
Description copied from interface: ExecutableArrayOperator

Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction) but only on selected elements, leaving all other elements untouched.

Specified by:
mapIfTrue in interface ILevel0ArrayOperator<I,T>
Specified by:
mapIfTrue in interface ExecutableArrayOperator<T>
Parameters:
eval - the evaluation function used to select elements
function - the function to be executed on the selected elements
Returns:
an operator on the results of function execution

mapIfTrue

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)
Description copied from interface: ExecutableArrayOperator

Maps a function in a way equivalent to ExecutableArrayOperator.map(IFunction) but only on selected elements, leaving all other elements untouched.

Specified by:
mapIfTrue in interface ILevel0ArrayOperator<I,T>
Specified by:
mapIfTrue in interface ExecutableArrayOperator<T>
Type Parameters:
X - the new type returned by the functions
Parameters:
newType - the new type returned by the functions
eval - the evaluation function used to select elements
function - the function to be executed on the selected elements
elseFunction - the function to be executed on the non-selected elements
Returns:
an operator on the results of function execution


Copyright © 2012 The OP4J team. All Rights Reserved.