|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object org.op4j.operators.impl.AbstractOperator org.op4j.operators.impl.op.array.Level0IndefiniteArrayOperator<I,T>
public final class Level0IndefiniteArrayOperator<I,T>
Constructor Summary | |
---|---|
Level0IndefiniteArrayOperator(Target target)
|
Method Summary | ||
---|---|---|
|
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. |
|
|
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. |
|
Level0GenericUniqOperator<I,T[]> |
generic()
Converts the specialized structure operator into generic operators (with no specific methods for structures - e.g. forEach()) |
|
T[] |
get()
Returns the target object this operator currently holds. |
|
|
of(org.javaruntype.type.Type<X> newType)
Casts the operator's target as an array of the specified type. |
|
Level0IndefiniteArrayOperator<I,T> |
reverse()
Reverses the elements of the structure. |
|
|
toGroupMapOf(org.javaruntype.type.Type<V> valueType,
IFunction<? super T,K> keyFunction,
IFunction<? super T,V> valueFunction)
|
|
|
toGroupMapOf(org.javaruntype.type.Type<V> valueType,
IFunction<? super T,Map.Entry<K,V>> mapBuilder)
|
|
Level0ListOperator<I,T> |
toList()
Converts the current target to a list. |
|
|
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. |
|
|
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. |
|
|
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. |
|
|
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. |
|
|
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. |
|
|
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. |
|
|
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. |
|
|
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. |
|
|
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. |
|
|
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 |
---|
public Level0IndefiniteArrayOperator(Target target)
Method Detail |
---|
public Level0ListOperator<I,T> toList()
ConvertibleToListOperator
Converts the current target to a list.
toList
in interface ILevel0IndefiniteArrayOperator<I,T>
toList
in interface ConvertibleToListOperator
public Level0MapOperator<I,T,T> couple()
ConvertibleToMapOperator
Converts the target object to a map, by using the even elements (starting at 0) as keys, and the odd elements as values.
couple
in interface ILevel0IndefiniteArrayOperator<I,T>
couple
in interface ConvertibleToMapOperator<T>
public <K> Level0MapOperator<I,K,T> zipKeysBy(IFunction<? super T,K> keyEval)
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).
zipKeysBy
in interface ILevel0IndefiniteArrayOperator<I,T>
zipKeysBy
in interface ConvertibleToMapOperator<T>
K
- the type of the keys that will be createdkeyEval
- the evaluator used for obtaining the keys
public <V> Level0MapOperator<I,T,V> zipValuesBy(IFunction<? super T,V> valueEval)
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).
zipValuesBy
in interface ILevel0IndefiniteArrayOperator<I,T>
zipValuesBy
in interface ConvertibleToMapOperator<T>
V
- the type of the values that will be createdvalueEval
- the evaluator used for obtaining the values
public <K> Level0MapOperator<I,K,T> zipKeys(K... keys)
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).
zipKeys
in interface ILevel0IndefiniteArrayOperator<I,T>
zipKeys
in interface ConvertibleToMapOperator<T>
K
- the type of the keyskeys
- the new keys
public <V> Level0MapOperator<I,T,V> zipValues(V... values)
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.
zipValues
in interface ILevel0IndefiniteArrayOperator<I,T>
zipValues
in interface ConvertibleToMapOperator<T>
V
- the type of the valuesvalues
- the new values
public <K,V> Level0MapOperator<I,K,V> toMap(IFunction<? super T,Map.Entry<K,V>> mapBuilder)
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).
toMap
in interface ILevel0IndefiniteArrayOperator<I,T>
toMap
in interface ConvertibleToMapOperator<T>
K
- the type of the keys that will be createdV
- the type of the values that will be createdmapBuilder
- the map builder function to be used
public <K,V> Level0MapOperator<I,K,V[]> toGroupMapOf(org.javaruntype.type.Type<V> valueType, IFunction<? super T,Map.Entry<K,V>> mapBuilder)
toGroupMapOf
in interface ILevel0IndefiniteArrayOperator<I,T>
public Level0SetOperator<I,T> toSet()
ConvertibleToSetOperator
Converts the current target into a set.
toSet
in interface ILevel0IndefiniteArrayOperator<I,T>
toSet
in interface ConvertibleToSetOperator
public Level0GenericUniqOperator<I,T[]> generic()
GenerizableOperator
Converts the specialized structure operator into generic operators (with no specific methods for structures - e.g. forEach())
generic
in interface ILevel0IndefiniteArrayOperator<I,T>
generic
in interface GenerizableOperator<I,T[]>
public <X> Level0GenericUniqOperator<I,X> exec(IFunction<? super T[],X> function)
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.
exec
in interface ILevel0IndefiniteArrayOperator<I,T>
exec
in interface ExecutableIndefiniteArrayOperator<I,T>
X
- the type of the result, and new type for the operatorfunction
- the function to be executed
public <X> Level0ArrayOperator<I,X> of(org.javaruntype.type.Type<X> newType)
CastableToArrayOperator
Casts the operator's target as an array of the specified type.
of
in interface ILevel0IndefiniteArrayOperator<I,T>
of
in interface CastableToArrayOperator
X
- the type of the elements of the arraynewType
- the type of the elements of the array
public <X> Level0ArrayOperator<I,X> castToArrayOf(org.javaruntype.type.Type<X> newType)
CastableToArrayOperator
Casts the operator's target as an array of the specified type.
castToArrayOf
in interface CastableToArrayOperator
X
- the type of the elements of the arraynewType
- the type of the elements of the array
public <K> Level0MapOperator<I,K,T> zipKeysFrom(Collection<K> keys)
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).
zipKeysFrom
in interface ConvertibleToMapOperator<T>
K
- the type of the keyskeys
- the new keys
public <K> Level0MapOperator<I,K,T> zipKeysFrom(K[] keys)
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).
zipKeysFrom
in interface ConvertibleToMapOperator<T>
K
- the type of the keyskeys
- the new keys
public <V> Level0MapOperator<I,T,V> zipValuesFrom(Collection<V> values)
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.
zipValuesFrom
in interface ConvertibleToMapOperator<T>
V
- the type of the valuesvalues
- the new values
public <V> Level0MapOperator<I,T,V> zipValuesFrom(V[] values)
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.
zipValuesFrom
in interface ConvertibleToMapOperator<T>
V
- the type of the valuesvalues
- the new values
public Level0IndefiniteArrayOperator<I,T> reverse()
ReversibleOperator
Reverses the elements of the structure.
reverse
in interface ILevel0IndefiniteArrayOperator<I,T>
reverse
in interface ReversibleOperator<T>
public <K,V> Level0MapOperator<I,K,V[]> toGroupMapOf(org.javaruntype.type.Type<V> valueType, IFunction<? super T,K> keyFunction, IFunction<? super T,V> valueFunction)
toGroupMapOf
in interface ILevel0IndefiniteArrayOperator<I,T>
public <K,V> Level0MapOperator<I,K,V> toMap(IFunction<? super T,K> keyFunction, IFunction<? super T,V> valueFunction)
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).
toMap
in interface ILevel0IndefiniteArrayOperator<I,T>
toMap
in interface ConvertibleToMapOperator<T>
K
- the type of the keys that will be createdV
- the type of the values that will be createdkeyFunction
- the function for building the keysvalueFunction
- the function for building the values
public T[] get()
UniqOpOperator
Returns the target object this operator currently holds.
get
in interface UniqOpOperator<I,T[]>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |