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

All Known Subinterfaces:
ILevel0ListOperator<I,T>
All Known Implementing Classes:
Level0ListOperator, Level0ListOperator

public interface ConvertibleToMapOfListOperator<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
toGroupMap(IFunction<? super T,K> keyFunction, IFunction<? super T,V> valueFunction)
           Converts the target object to a map by inputting the original target's elements into the specified map builder (a function returning map entries) which will create the resulting keys and values.
<K,V> Operator
toGroupMap(IFunction<? super T,Map.Entry<K,V>> mapBuilder)
           Converts the target object to a map by inputting the original target's elements into the specified map builder (a function returning map entries) which will create the resulting keys and values.
<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(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(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(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(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

toGroupMap

<K,V> Operator toGroupMap(IFunction<? super T,Map.Entry<K,V>> mapBuilder)

Converts the target object to a map by inputting the original target's elements into the specified map builder (a function returning map entries) which will create the resulting keys and values. Values with the same key will be grouped into lists.

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.

toGroupMap

<K,V> Operator toGroupMap(IFunction<? super T,K> keyFunction,
                          IFunction<? super T,V> valueFunction)

Converts the target object to a map by inputting the original target's elements into the specified map builder (a function returning map entries) which will create the resulting keys and values. Values with the same key will be grouped into lists.

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.

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 lists.

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 lists.

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(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 lists.

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.

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 lists.

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(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 lists.

Type Parameters:
V - the type of the values that will be created
Parameters:
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 lists.

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(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 lists.

Type Parameters:
V - the type of the values that will be created
Parameters:
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 lists.

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(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 lists.

Type Parameters:
V - the type of the values that will be created
Parameters:
values - the values to be zipped
Returns:
an operator holding the converted object as target.


Copyright © 2012 The OP4J team. All Rights Reserved.