|
||||||||||
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.fn.generic.Level0GenericUniqOperator<I,T>
public final class Level0GenericUniqOperator<I,T>
Constructor Summary | |
---|---|
Level0GenericUniqOperator(Target target)
|
Method Summary | ||
---|---|---|
|
castTo(org.javaruntype.type.Type<X> type)
Casts the operator's target as the specified type. |
|
|
castToArrayOf(org.javaruntype.type.Type<X> type)
Casts the operator's target as an array of the specified type. |
|
|
castToListOf(org.javaruntype.type.Type<X> type)
Casts the operator's target as a list of the specified type. |
|
|
castToMapOf(org.javaruntype.type.Type<K> keyType,
org.javaruntype.type.Type<V> valueType)
Casts the operator's target as a map of the specified types. |
|
|
castToSetOf(org.javaruntype.type.Type<X> type)
Casts the operator's target as a set of the specified type. |
|
|
exec(IFunction<? super T,X> function)
Executes the specified function on the target object, creating a new operator containing the result of the execution. |
|
Level0GenericUniqOperator<I,T> |
execIfFalse(IFunction<? super T,Boolean> eval,
IFunction<? super T,? extends T> function)
Executes a function in a way equivalent to ExecutableOperator.exec(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
execIfFalse(IFunction<? super T,Boolean> eval,
IFunction<? super T,X> function,
IFunction<? super T,X> elseFunction)
Executes a function in a way equivalent to ExecutableOperator.exec(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level0GenericUniqOperator<I,T> |
execIfNotNull(IFunction<? super T,? extends T> function)
Executes a function in a way equivalent to ExecutableOperator.exec(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
execIfNotNull(IFunction<? super T,X> function,
IFunction<? super T,X> elseFunction)
Executes a function in a way equivalent to ExecutableOperator.exec(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level0GenericUniqOperator<I,T> |
execIfNull(IFunction<? super T,? extends T> function)
Executes a function in a way equivalent to ExecutableOperator.exec(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
execIfNull(IFunction<? super T,X> function,
IFunction<? super T,X> elseFunction)
Executes a function in a way equivalent to ExecutableOperator.exec(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level0GenericUniqOperator<I,T> |
execIfTrue(IFunction<? super T,Boolean> eval,
IFunction<? super T,? extends T> function)
Executes a function in a way equivalent to ExecutableOperator.exec(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
execIfTrue(IFunction<? super T,Boolean> eval,
IFunction<? super T,X> function,
IFunction<? super T,X> elseFunction)
Executes a function in a way equivalent to ExecutableOperator.exec(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Function<I,T> |
get()
Returns a function which will execute all the logic specified from the "Fn.on" expression. |
|
Level0GenericUniqSelectedOperator<I,T> |
ifFalse(IFunction<? super T,Boolean> eval)
Selects only those targets for which the specified evaluator returns false. |
|
Level0GenericUniqSelectedOperator<I,T> |
ifNotNull()
Selects only those targets which are not null. |
|
Level0GenericUniqSelectedOperator<I,T> |
ifNull()
Selects only those targets which are null. |
|
Level0GenericUniqSelectedOperator<I,T> |
ifTrue(IFunction<? super T,Boolean> eval)
Selects only those targets for which the specified evaluator returns true. |
|
Level0ArrayOperator<I,T> |
intoSingletonArrayOf(org.javaruntype.type.Type<T> type)
Builds an array of the specified type containing the operator's targets. |
|
Level0ListOperator<I,T> |
intoSingletonList()
Builds a list containing the operator's targets. |
|
|
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. |
|
Level0SetOperator<I,T> |
intoSingletonSet()
Builds a set containing the operator's targets. |
|
Level0GenericUniqOperator<I,T> |
replaceIfNullWith(T replacement)
Replaces the current target object with the specified replacement if the current target is null. |
|
Level0GenericUniqOperator<I,T> |
replaceWith(T replacement)
Replaces the current target object with the specified replacement. |
|
|
zipKey(K key)
Builds a one-entry map using the operator's target as a value, and the specified object as a key. |
|
|
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. |
|
|
zipValue(V value)
Builds a one-entry map using the operator's target as a key, and the specified object as a value. |
|
|
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. |
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 Level0GenericUniqOperator(Target target)
Method Detail |
---|
public Level0ArrayOperator<I,T> intoSingletonArrayOf(org.javaruntype.type.Type<T> type)
BuilderOperator
Builds an array of the specified type containing the operator's targets.
intoSingletonArrayOf
in interface ILevel0GenericUniqOperator<I,T>
intoSingletonArrayOf
in interface BuilderOperator<I,T>
type
- the type if which the array will be instantiated
public Level0ListOperator<I,T> intoSingletonList()
BuilderOperator
Builds a list containing the operator's targets.
intoSingletonList
in interface ILevel0GenericUniqOperator<I,T>
intoSingletonList
in interface BuilderOperator<I,T>
public <K> Level0MapOperator<I,K,T> zipKeyBy(IFunction<? super T,K> keyEval)
BuilderOperator
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.
zipKeyBy
in interface ILevel0GenericUniqOperator<I,T>
zipKeyBy
in interface BuilderOperator<I,T>
K
- the type of the new key, resulting from evaluating keyEvalkeyEval
- the evaluator to be used for obtaining the key
public <V> Level0MapOperator<I,T,V> zipValueBy(IFunction<? super T,V> valueEval)
BuilderOperator
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.
zipValueBy
in interface ILevel0GenericUniqOperator<I,T>
zipValueBy
in interface BuilderOperator<I,T>
V
- the type of the new value, resulting from evaluating valueEvalvalueEval
- the evaluator to be used for obtaining the value
public <K> Level0MapOperator<I,K,T> zipKey(K key)
BuilderOperator
Builds a one-entry map using the operator's target as a value, and the specified object as a key.
zipKey
in interface ILevel0GenericUniqOperator<I,T>
zipKey
in interface BuilderOperator<I,T>
K
- the type of the new key, resulting from evaluating keyEvalkey
- the key to be zipped
public <V> Level0MapOperator<I,T,V> zipValue(V value)
BuilderOperator
Builds a one-entry map using the operator's target as a key, and the specified object as a value.
zipValue
in interface ILevel0GenericUniqOperator<I,T>
zipValue
in interface BuilderOperator<I,T>
V
- the type of the new value, resulting from evaluating valueEvalvalue
- the value to be zipped
public <K,V> Level0MapOperator<I,K,V> intoSingletonMap(IFunction<? super T,Map.Entry<K,V>> mapBuilder)
BuilderOperator
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.
intoSingletonMap
in interface ILevel0GenericUniqOperator<I,T>
intoSingletonMap
in interface BuilderOperator<I,T>
K
- the type of the keys returned by the map builderV
- the type of the values returned by the map buildermapBuilder
- the map builder function
public Level0SetOperator<I,T> intoSingletonSet()
BuilderOperator
Builds a set containing the operator's targets.
intoSingletonSet
in interface ILevel0GenericUniqOperator<I,T>
intoSingletonSet
in interface BuilderOperator<I,T>
public <X> Level0ArrayOperator<I,X> castToArrayOf(org.javaruntype.type.Type<X> type)
CastableToStructuresOperator
Casts the operator's target as an array of the specified type.
castToArrayOf
in interface ILevel0GenericUniqOperator<I,T>
castToArrayOf
in interface CastableToStructuresOperator
X
- the type of the elements of the arraytype
- the type of the elements of the array
public <X> Level0ListOperator<I,X> castToListOf(org.javaruntype.type.Type<X> type)
CastableToStructuresOperator
Casts the operator's target as a list of the specified type.
castToListOf
in interface ILevel0GenericUniqOperator<I,T>
castToListOf
in interface CastableToStructuresOperator
X
- the type of the elements of the listtype
- the type of the elements of the list
public <K,V> Level0MapOperator<I,K,V> castToMapOf(org.javaruntype.type.Type<K> keyType, org.javaruntype.type.Type<V> valueType)
CastableToStructuresOperator
Casts the operator's target as a map of the specified types.
castToMapOf
in interface ILevel0GenericUniqOperator<I,T>
castToMapOf
in interface CastableToStructuresOperator
K
- the type for the map's keysV
- the type for the map's valueskeyType
- the type for the map's keysvalueType
- the type for the map's values
public <X> Level0SetOperator<I,X> castToSetOf(org.javaruntype.type.Type<X> type)
CastableToStructuresOperator
Casts the operator's target as a set of the specified type.
castToSetOf
in interface ILevel0GenericUniqOperator<I,T>
castToSetOf
in interface CastableToStructuresOperator
X
- the type of the elements of the settype
- the type of the elements of the set
public <X> Level0GenericUniqOperator<I,X> castTo(org.javaruntype.type.Type<X> type)
CastableToTypeOperator
Casts the operator's target as the specified type.
castTo
in interface ILevel0GenericUniqOperator<I,T>
castTo
in interface CastableToTypeOperator<T>
X
- the type of the targetstype
- the type of targets
public Function<I,T> get()
UniqFnOperator
Returns a function which will execute all the logic specified from the "Fn.on" expression.
get
in interface UniqFnOperator<I,T>
public Level0GenericUniqSelectedOperator<I,T> ifTrue(IFunction<? super T,Boolean> eval)
SelectableOperator
Selects only those targets for which the specified evaluator returns true. After this method, all the subsequently executed operations will only be executed on the target objects selected here, until an "endIf()" method is called.
ifTrue
in interface ILevel0GenericUniqOperator<I,T>
ifTrue
in interface SelectableOperator<T>
eval
- the evaluator to be used for selecting targets.
public Level0GenericUniqSelectedOperator<I,T> ifFalse(IFunction<? super T,Boolean> eval)
SelectableOperator
Selects only those targets for which the specified evaluator returns false. After this method, all the subsequently executed operations will only be executed on the target objects selected here, until an "endIf()" method is called.
ifFalse
in interface ILevel0GenericUniqOperator<I,T>
ifFalse
in interface SelectableOperator<T>
eval
- the evaluator to be used for selecting targets.
public Level0GenericUniqSelectedOperator<I,T> ifNotNull()
SelectableOperator
Selects only those targets which are not null. After this method, all the subsequently executed operations will only be executed on the target objects selected here, until an "endIf()" method is called.
ifNotNull
in interface ILevel0GenericUniqOperator<I,T>
ifNotNull
in interface SelectableOperator<T>
public Level0GenericUniqSelectedOperator<I,T> ifNull()
SelectableOperator
Selects only those targets which are null. After this method, all the subsequently executed operations will only be executed on the target objects selected here, until an "endIf()" method is called.
ifNull
in interface ILevel0GenericUniqOperator<I,T>
ifNull
in interface SelectableOperator<T>
public <X> Level0GenericUniqOperator<I,X> exec(IFunction<? super T,X> function)
ExecutableOperator
Executes the specified function on the target object, creating a new operator containing the result of the execution.
This function must be able to take as input an object 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 ILevel0GenericUniqOperator<I,T>
exec
in interface ExecutableOperator<T>
X
- the type of the result, and new type for the operatorfunction
- the function to be executed
public Level0GenericUniqOperator<I,T> replaceWith(T replacement)
ReplaceableOperator
Replaces the current target object with the specified replacement.
replaceWith
in interface ILevel0GenericUniqOperator<I,T>
replaceWith
in interface ReplaceableOperator<T>
replacement
- the object which will replace the current target object.
public Level0GenericUniqOperator<I,T> replaceIfNullWith(T replacement)
ReplaceableIfNullOperator
Replaces the current target object with the specified replacement if the current target is null.
replaceIfNullWith
in interface ILevel0GenericUniqOperator<I,T>
replaceIfNullWith
in interface ReplaceableIfNullOperator<T>
replacement
- the object which will replace the current target object if target is null.
public Level0GenericUniqOperator<I,T> execIfFalse(IFunction<? super T,Boolean> eval, IFunction<? super T,? extends T> function)
ExecutableOperator
Executes a function in a way equivalent to ExecutableOperator.exec(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfFalse
in interface ILevel0GenericUniqOperator<I,T>
execIfFalse
in interface ExecutableOperator<T>
eval
- the evaluation function used to select elementsfunction
- the function to be executed on the selected elements
public <X> Level0GenericUniqOperator<I,X> execIfFalse(IFunction<? super T,Boolean> eval, IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
ExecutableOperator
Executes a function in a way equivalent to ExecutableOperator.exec(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfFalse
in interface ILevel0GenericUniqOperator<I,T>
execIfFalse
in interface ExecutableOperator<T>
X
- the new type returned by the functionseval
- the evaluation function used to select elementsfunction
- the function to be executed on the selected elementselseFunction
- the function to be executed on the non-selected elements
public Level0GenericUniqOperator<I,T> execIfNotNull(IFunction<? super T,? extends T> function)
ExecutableOperator
Executes a function in a way equivalent to ExecutableOperator.exec(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfNotNull
in interface ILevel0GenericUniqOperator<I,T>
execIfNotNull
in interface ExecutableOperator<T>
function
- the function to be executed on the selected elements
public <X> Level0GenericUniqOperator<I,X> execIfNotNull(IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
ExecutableOperator
Executes a function in a way equivalent to ExecutableOperator.exec(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfNotNull
in interface ILevel0GenericUniqOperator<I,T>
execIfNotNull
in interface ExecutableOperator<T>
X
- the new type returned by the functionsfunction
- the function to be executed on the selected elementselseFunction
- the function to be executed on the non-selected elements
public Level0GenericUniqOperator<I,T> execIfNull(IFunction<? super T,? extends T> function)
ExecutableOperator
Executes a function in a way equivalent to ExecutableOperator.exec(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfNull
in interface ILevel0GenericUniqOperator<I,T>
execIfNull
in interface ExecutableOperator<T>
function
- the function to be executed on the selected elements
public <X> Level0GenericUniqOperator<I,X> execIfNull(IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
ExecutableOperator
Executes a function in a way equivalent to ExecutableOperator.exec(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfNull
in interface ILevel0GenericUniqOperator<I,T>
execIfNull
in interface ExecutableOperator<T>
X
- the new type returned by the functionsfunction
- the function to be executed on the selected elementselseFunction
- the function to be executed on the non-selected elements
public Level0GenericUniqOperator<I,T> execIfTrue(IFunction<? super T,Boolean> eval, IFunction<? super T,? extends T> function)
ExecutableOperator
Executes a function in a way equivalent to ExecutableOperator.exec(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfTrue
in interface ILevel0GenericUniqOperator<I,T>
execIfTrue
in interface ExecutableOperator<T>
eval
- the evaluation function used to select elementsfunction
- the function to be executed on the selected elements
public <X> Level0GenericUniqOperator<I,X> execIfTrue(IFunction<? super T,Boolean> eval, IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
ExecutableOperator
Executes a function in a way equivalent to ExecutableOperator.exec(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfTrue
in interface ILevel0GenericUniqOperator<I,T>
execIfTrue
in interface ExecutableOperator<T>
X
- the new type returned by the functionseval
- the evaluation function used to select elementsfunction
- the function to be executed on the selected elementselseFunction
- the function to be executed on the non-selected elements
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |