org.op4j.operators.intf.array
Interface ILevel0IndefiniteArrayOperator<I,T>

All Superinterfaces:
CastableToArrayOperator, ConvertibleToListOperator, ConvertibleToMapOperator<T>, ConvertibleToSetOperator, ExecutableIndefiniteArrayOperator<I,T>, GenerizableOperator<I,T[]>, Operator, ReversibleOperator<T>, UniqOperator<T[]>
All Known Implementing Classes:
Level0IndefiniteArrayOperator

public interface ILevel0IndefiniteArrayOperator<I,T>
extends UniqOperator<T[]>, CastableToArrayOperator, GenerizableOperator<I,T[]>, ConvertibleToListOperator, ConvertibleToSetOperator, ConvertibleToMapOperator<T>, ExecutableIndefiniteArrayOperator<I,T>, ReversibleOperator<T>

Since:
1.0
Author:
Daniel Fernández

Method Summary
 ILevel0MapOperator<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.
<X> ILevel0GenericUniqOperator<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.
 ILevel0GenericUniqOperator<I,T[]> generic()
           Converts the specialized structure operator into generic operators (with no specific methods for structures - e.g. forEach())
<X> ILevel0ArrayOperator<I,X>
of(org.javaruntype.type.Type<X> type)
           Casts the operator's target as an array of the specified type.
 ILevel0IndefiniteArrayOperator<I,T> reverse()
           Reverses the elements of the structure.
<K,V> ILevel0MapOperator<I,K,V[]>
toGroupMapOf(org.javaruntype.type.Type<V> valueType, IFunction<? super T,K> keyFunction, IFunction<? super T,V> valueFunction)
           
<K,V> ILevel0MapOperator<I,K,V[]>
toGroupMapOf(org.javaruntype.type.Type<V> valueType, IFunction<? super T,Map.Entry<K,V>> mapBuilder)
           
 ILevel0ListOperator<I,T> toList()
           Converts the current target to a list.
<K,V> ILevel0MapOperator<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> ILevel0MapOperator<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.
 ILevel0SetOperator<I,T> toSet()
           Converts the current target into a set.
<K> ILevel0MapOperator<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> ILevel0MapOperator<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.
<V> ILevel0MapOperator<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> ILevel0MapOperator<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.
 
Methods inherited from interface org.op4j.operators.qualities.CastableToArrayOperator
castToArrayOf
 
Methods inherited from interface org.op4j.operators.qualities.ConvertibleToMapOperator
zipKeysFrom, zipKeysFrom, zipValuesFrom, zipValuesFrom
 

Method Detail

toList

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

Converts the current target to a list.

Specified by:
toList in interface ConvertibleToListOperator
Returns:
an operator holding the converted object as target.

toSet

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

Converts the current target into a set.

Specified by:
toSet in interface ConvertibleToSetOperator
Returns:
an operator holding the converted object as target.

toMap

<K,V> ILevel0MapOperator<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 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.

toMap

<K,V> ILevel0MapOperator<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 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.

toGroupMapOf

<K,V> ILevel0MapOperator<I,K,V[]> toGroupMapOf(org.javaruntype.type.Type<V> valueType,
                                               IFunction<? super T,Map.Entry<K,V>> mapBuilder)

toGroupMapOf

<K,V> ILevel0MapOperator<I,K,V[]> toGroupMapOf(org.javaruntype.type.Type<V> valueType,
                                               IFunction<? super T,K> keyFunction,
                                               IFunction<? super T,V> valueFunction)

couple

ILevel0MapOperator<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 ConvertibleToMapOperator<T>
Returns:
an operator holding the converted object as target.

zipKeys

<K> ILevel0MapOperator<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 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

<V> ILevel0MapOperator<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 ConvertibleToMapOperator<T>
Type Parameters:
V - the type of the values
Parameters:
values - the new values
Returns:
an operator holding the converted object as target.

zipKeysBy

<K> ILevel0MapOperator<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 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

<V> ILevel0MapOperator<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 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.

generic

ILevel0GenericUniqOperator<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 GenerizableOperator<I,T[]>
Returns:
a generic operator on the same target object

of

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

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

Specified by:
of in interface CastableToArrayOperator
Type Parameters:
X - the type of the elements of the array
Parameters:
type - the type of the elements of the array
Returns:
the resulting casted operator

exec

<X> ILevel0GenericUniqOperator<I,X> exec(IFunction<? super T[],X> function)
Description copied from interface: ExecutableIndefiniteArrayOperator

Executes the specified function on the target object, creating a new generic operator containing the result of the execution.

This function must be able to take as input an array of type T (the current operator's target type) and will return an object of type X, which will be from then on the new operator's target type.

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

reverse

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

Reverses the elements of the structure.

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


Copyright © 2012 The OP4J team. All Rights Reserved.