org.op4j.operators.qualities
Interface BuilderOperator<I,T>

All Known Subinterfaces:
ILevel0GenericUniqOperator<I,T>
All Known Implementing Classes:
Level0GenericUniqOperator, Level0GenericUniqOperator

public interface BuilderOperator<I,T>

This interface defines methods for the building of structures from generic non-multi operators.

Since:
1.0
Author:
Daniel Fernández

Method Summary
 ILevel0ArrayOperator<I,T> intoSingletonArrayOf(org.javaruntype.type.Type<T> type)
           Builds an array of the specified type containing the operator's targets.
 ILevel0ListOperator<I,T> intoSingletonList()
           Builds a list containing the operator's targets.
<K,V> ILevel0MapOperator<I,K,V>
intoSingletonMap(IFunction<? super T,Map.Entry<K,V>> mapBuilder)
           Builds a map by inputting the operator's targets into a map builder object (a function returning map entries), which is in charge of creating the corresponding key and value for each original target.
 ILevel0SetOperator<I,T> intoSingletonSet()
           Builds a set containing the operator's targets.
<K> ILevel0MapOperator<I,K,T>
zipKey(K key)
           Builds a one-entry map using the operator's target as a value, and the specified object as a key.
<K> ILevel0MapOperator<I,K,T>
zipKeyBy(IFunction<? super T,K> keyEval)
           Builds a one-entry map using the operator's target as a value, and the result of executing the keyEval evaluator on the target as a key.
<V> ILevel0MapOperator<I,T,V>
zipValue(V value)
           Builds a one-entry map using the operator's target as a key, and the specified object as a value.
<V> ILevel0MapOperator<I,T,V>
zipValueBy(IFunction<? super T,V> valueEval)
           Builds a one-entry map using the operator's target as a key, and the result of executing the valueEval evaluator on the target as a value.
 

Method Detail

intoSingletonList

ILevel0ListOperator<I,T> intoSingletonList()

Builds a list containing the operator's targets.

Returns:
an operator on the resulting list

intoSingletonSet

ILevel0SetOperator<I,T> intoSingletonSet()

Builds a set containing the operator's targets.

Returns:
an operator on the resulting set

intoSingletonArrayOf

ILevel0ArrayOperator<I,T> intoSingletonArrayOf(org.javaruntype.type.Type<T> type)

Builds an array of the specified type containing the operator's targets.

Parameters:
type - the type if which the array will be instantiated
Returns:
an operator on the resulting array

zipKeyBy

<K> ILevel0MapOperator<I,K,T> zipKeyBy(IFunction<? super T,K> keyEval)

Builds a one-entry map using the operator's target as a value, and the result of executing the keyEval evaluator on the target as a key.

Type Parameters:
K - the type of the new key, resulting from evaluating keyEval
Parameters:
keyEval - the evaluator to be used for obtaining the key
Returns:
an operator on the resulting map

zipValueBy

<V> ILevel0MapOperator<I,T,V> zipValueBy(IFunction<? super T,V> valueEval)

Builds a one-entry map using the operator's target as a key, and the result of executing the valueEval evaluator on the target as a value.

Type Parameters:
V - the type of the new value, resulting from evaluating valueEval
Parameters:
valueEval - the evaluator to be used for obtaining the value
Returns:
an operator on the resulting map

zipKey

<K> ILevel0MapOperator<I,K,T> zipKey(K key)

Builds a one-entry map using the operator's target as a value, and the specified object as a key.

Type Parameters:
K - the type of the new key, resulting from evaluating keyEval
Parameters:
key - the key to be zipped
Returns:
an operator on the resulting map

zipValue

<V> ILevel0MapOperator<I,T,V> zipValue(V value)

Builds a one-entry map using the operator's target as a key, and the specified object as a value.

Type Parameters:
V - the type of the new value, resulting from evaluating valueEval
Parameters:
value - the value to be zipped
Returns:
an operator on the resulting map

intoSingletonMap

<K,V> ILevel0MapOperator<I,K,V> intoSingletonMap(IFunction<? super T,Map.Entry<K,V>> mapBuilder)

Builds a map by inputting the operator's targets into a map builder object (a function returning map entries), which is in charge of creating the corresponding key and value for each original target. If two values have the same key, all of them but the last to be evaluated will be overwritten.

Type Parameters:
K - the type of the keys returned by the map builder
V - the type of the values returned by the map builder
Parameters:
mapBuilder - the map builder function
Returns:
an operator on the resulting map


Copyright © 2012 The OP4J team. All Rights Reserved.