org.op4j.operators.qualities
Interface ConvertibleToMapOfArrayOperator<T>

All Known Subinterfaces:
ILevel0ArrayOperator<I,T>
All Known Implementing Classes:
Level0ArrayOperator, Level0ArrayOperator

public interface ConvertibleToMapOfArrayOperator<T>

This interface contains methods for conversions to map of array (array group map).

Since:
1.0
Author:
Daniel Fernández

Method Summary
 Operator coupleAndGroup()
           Converts the target object to a map, by using the even elements (starting at 0) as keys, and the odd elements as values.
<K,V> Operator
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> Operator
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.
<K> Operator
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> Operator
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> Operator
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> Operator
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> Operator
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> Operator
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> Operator
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> Operator
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.
 

Method Detail

toGroupMapOf

<K,V> Operator 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. Values with the same key will be grouped into arrays.

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.

toGroupMapOf

<K,V> Operator 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. Values with the same key will be grouped into arrays.

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.

coupleAndGroup

Operator coupleAndGroup()

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.

Returns:
an operator holding the converted object as target.

zipAndGroupKeysBy

<K> Operator 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. Values with the same key will be grouped into arrays.

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

<V> Operator 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. Values with the same key will be grouped into arrays.

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

<K> Operator zipAndGroupKeys(K... keys)

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.

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

<V> Operator 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. Values with the same key will be grouped into arrays.

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.

zipAndGroupKeysFrom

<K> Operator 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. Values with the same key will be grouped into arrays.

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

<V> Operator 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. Values with the same key will be grouped into arrays.

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.

zipAndGroupKeysFrom

<K> Operator zipAndGroupKeysFrom(K[] keys)

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.

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

<V> Operator 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. Values with the same key will be grouped into arrays.

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.


Copyright © 2012 The OP4J team. All Rights Reserved.