|
||||||||||
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.list.Level1ListElementsOperator<I,T>
public final class Level1ListElementsOperator<I,T>
Constructor Summary | |
---|---|
Level1ListElementsOperator(Target target)
|
Method Summary | ||
---|---|---|
|
castTo(org.javaruntype.type.Type<X> type)
Casts the operator's target as the specified type. |
|
Level0ListOperator<I,T> |
endFor()
Ends the current iteration. |
|
|
exec(IFunction<? super T,X> function)
Executes the specified function on the target object, creating a new array containing the result of the execution. |
|
Level1ListElementsOperator<I,T> |
execIfFalse(IFunction<? super T,Boolean> eval,
IFunction<? super T,? extends T> function)
Executes a function in a way equivalent to ExecutableElementsOperator.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 ExecutableElementsOperator.exec(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level1ListElementsOperator<I,T> |
execIfIndex(int[] indexes,
IFunction<? super T,? extends T> function)
Executes a function in a way equivalent to ExecutableElementsOperator.exec(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
execIfIndex(int[] indexes,
IFunction<? super T,X> function,
IFunction<? super T,X> elseFunction)
Executes a function in a way equivalent to ExecutableElementsOperator.exec(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level1ListElementsOperator<I,T> |
execIfIndexNot(int[] indexes,
IFunction<? super T,? extends T> function)
Executes a function in a way equivalent to ExecutableElementsOperator.exec(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
|
execIfIndexNot(int[] indexes,
IFunction<? super T,X> function,
IFunction<? super T,X> elseFunction)
Executes a function in a way equivalent to ExecutableElementsOperator.exec(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level1ListElementsOperator<I,T> |
execIfNotNull(IFunction<? super T,? extends T> function)
Executes a function in a way equivalent to ExecutableElementsOperator.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 ExecutableElementsOperator.exec(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level1ListElementsOperator<I,T> |
execIfNull(IFunction<? super T,? extends T> function)
Executes a function in a way equivalent to ExecutableElementsOperator.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 ExecutableElementsOperator.exec(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
Level1ListElementsOperator<I,T> |
execIfTrue(IFunction<? super T,Boolean> eval,
IFunction<? super T,? extends T> function)
Executes a function in a way equivalent to ExecutableElementsOperator.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 ExecutableElementsOperator.exec(IFunction) but only
on selected elements, leaving all other elements untouched. |
|
List<T> |
get()
Returns the target object this operator currently holds. |
|
Level1ListElementsSelectedOperator<I,T> |
ifFalse(IFunction<? super T,Boolean> eval)
Selects only those targets for which the specified evaluator returns false. |
|
Level1ListElementsSelectedOperator<I,T> |
ifIndex(int... indexes)
Selects only those targets which index in the current level of iteration matches any of the specified indexes. |
|
Level1ListElementsSelectedOperator<I,T> |
ifIndexNot(int... indexes)
Selects only those targets which index in the current level of iteration does not match any of the specified indexes. |
|
Level1ListElementsSelectedOperator<I,T> |
ifNotNull()
Selects only those targets which are not null. |
|
Level1ListElementsSelectedOperator<I,T> |
ifNull()
Selects only those targets which are null. |
|
Level1ListElementsSelectedOperator<I,T> |
ifTrue(IFunction<? super T,Boolean> eval)
Selects only those targets for which the specified evaluator returns true. |
|
Level1ListElementsOperator<I,T> |
replaceIfNullWith(T replacement)
Replaces the current target object with the specified replacement if the current target is null. |
|
Level1ListElementsOperator<I,T> |
replaceWith(T replacement)
Replaces the current target object with the specified replacement. |
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 Level1ListElementsOperator(Target target)
Method Detail |
---|
public Level0ListOperator<I,T> endFor()
NavigatingCollectionOperator
Ends the current iteration. After the execution of this method, all subsequent operations will be applied on the iterated collection as a whole instead of in a by-element basis.
endFor
in interface ILevel1ListElementsOperator<I,T>
endFor
in interface NavigatingCollectionOperator<T>
public <X> Level1ListElementsOperator<I,X> castTo(org.javaruntype.type.Type<X> type)
CastableToTypeOperator
Casts the operator's target as the specified type.
castTo
in interface ILevel1ListElementsOperator<I,T>
castTo
in interface CastableToTypeOperator<T>
X
- the type of the targetstype
- the type of targets
public List<T> get()
UniqOpOperator
Returns the target object this operator currently holds.
get
in interface UniqOpOperator<I,List<T>>
public Level1ListElementsSelectedOperator<I,T> ifIndex(int... indexes)
SelectableElementsOperator
Selects only those targets which index in the current level of iteration matches any of the specified indexes. After this method, all the subsequently executed operations will only be executed on the target objects selected here, until an "endIf()" method is called.
ifIndex
in interface ILevel1ListElementsOperator<I,T>
ifIndex
in interface SelectableElementsOperator<T>
indexes
- the indexes of the target objects which will be selected.
public Level1ListElementsSelectedOperator<I,T> ifIndexNot(int... indexes)
SelectableElementsOperator
Selects only those targets which index in the current level of iteration does not match any of the specified indexes. After this method, all the subsequently executed operations will only be executed on the target objects selected here, until an "endIf()" method is called.
ifIndexNot
in interface ILevel1ListElementsOperator<I,T>
ifIndexNot
in interface SelectableElementsOperator<T>
indexes
- the indexes of the target objects which will be selected.
public Level1ListElementsSelectedOperator<I,T> ifTrue(IFunction<? super T,Boolean> eval)
SelectableElementsOperator
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 ILevel1ListElementsOperator<I,T>
ifTrue
in interface SelectableElementsOperator<T>
eval
- the evaluator to be used for selecting targets.
public Level1ListElementsSelectedOperator<I,T> ifFalse(IFunction<? super T,Boolean> eval)
SelectableElementsOperator
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 ILevel1ListElementsOperator<I,T>
ifFalse
in interface SelectableElementsOperator<T>
eval
- the evaluator to be used for selecting targets.
public Level1ListElementsSelectedOperator<I,T> ifNotNull()
SelectableElementsOperator
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 ILevel1ListElementsOperator<I,T>
ifNotNull
in interface SelectableElementsOperator<T>
public Level1ListElementsSelectedOperator<I,T> ifNull()
SelectableElementsOperator
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 ILevel1ListElementsOperator<I,T>
ifNull
in interface SelectableElementsOperator<T>
public <X> Level1ListElementsOperator<I,X> exec(IFunction<? super T,X> function)
ExecutableElementsOperator
Executes the specified function on the target object, creating a new array 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 ILevel1ListElementsOperator<I,T>
exec
in interface ExecutableElementsOperator<T>
X
- the type of the result, and new type for the operatorfunction
- the function to be executed
public Level1ListElementsOperator<I,T> replaceWith(T replacement)
ReplaceableOperator
Replaces the current target object with the specified replacement.
replaceWith
in interface ILevel1ListElementsOperator<I,T>
replaceWith
in interface ReplaceableOperator<T>
replacement
- the object which will replace the current target object.
public Level1ListElementsOperator<I,T> replaceIfNullWith(T replacement)
ReplaceableIfNullOperator
Replaces the current target object with the specified replacement if the current target is null.
replaceIfNullWith
in interface ILevel1ListElementsOperator<I,T>
replaceIfNullWith
in interface ReplaceableIfNullOperator<T>
replacement
- the object which will replace the current target object if target is null.
public Level1ListElementsOperator<I,T> execIfFalse(IFunction<? super T,Boolean> eval, IFunction<? super T,? extends T> function)
ExecutableElementsOperator
Executes a function in a way equivalent to ExecutableElementsOperator.exec(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfFalse
in interface ILevel1ListElementsOperator<I,T>
execIfFalse
in interface ExecutableElementsOperator<T>
eval
- the evaluation function used to select elementsfunction
- the function to be executed on the selected elements
public <X> Level1ListElementsOperator<I,X> execIfFalse(IFunction<? super T,Boolean> eval, IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
ExecutableElementsOperator
Executes a function in a way equivalent to ExecutableElementsOperator.exec(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfFalse
in interface ILevel1ListElementsOperator<I,T>
execIfFalse
in interface ExecutableElementsOperator<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 Level1ListElementsOperator<I,T> execIfIndex(int[] indexes, IFunction<? super T,? extends T> function)
ExecutableElementsOperator
Executes a function in a way equivalent to ExecutableElementsOperator.exec(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfIndex
in interface ILevel1ListElementsOperator<I,T>
execIfIndex
in interface ExecutableElementsOperator<T>
indexes
- the iteration indexes that will be selectedfunction
- the function to be executed on the selected elements
public <X> Level1ListElementsOperator<I,X> execIfIndex(int[] indexes, IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
ExecutableElementsOperator
Executes a function in a way equivalent to ExecutableElementsOperator.exec(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfIndex
in interface ILevel1ListElementsOperator<I,T>
execIfIndex
in interface ExecutableElementsOperator<T>
X
- the new type returned by the functionsindexes
- the iteration indexes that will be selectedfunction
- the function to be executed on the selected elementselseFunction
- the function to be executed on the non-selected elements
public Level1ListElementsOperator<I,T> execIfIndexNot(int[] indexes, IFunction<? super T,? extends T> function)
ExecutableElementsOperator
Executes a function in a way equivalent to ExecutableElementsOperator.exec(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfIndexNot
in interface ILevel1ListElementsOperator<I,T>
execIfIndexNot
in interface ExecutableElementsOperator<T>
indexes
- the iteration indexes that will not be selectedfunction
- the function to be executed on the selected elements
public <X> Level1ListElementsOperator<I,X> execIfIndexNot(int[] indexes, IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
ExecutableElementsOperator
Executes a function in a way equivalent to ExecutableElementsOperator.exec(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfIndexNot
in interface ILevel1ListElementsOperator<I,T>
execIfIndexNot
in interface ExecutableElementsOperator<T>
X
- the new type returned by the functionsindexes
- the iteration indexes that will not be selectedfunction
- the function to be executed on the selected elementselseFunction
- the function to be executed on the non-selected elements
public Level1ListElementsOperator<I,T> execIfNotNull(IFunction<? super T,? extends T> function)
ExecutableElementsOperator
Executes a function in a way equivalent to ExecutableElementsOperator.exec(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfNotNull
in interface ILevel1ListElementsOperator<I,T>
execIfNotNull
in interface ExecutableElementsOperator<T>
function
- the function to be executed on the selected elements
public <X> Level1ListElementsOperator<I,X> execIfNotNull(IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
ExecutableElementsOperator
Executes a function in a way equivalent to ExecutableElementsOperator.exec(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfNotNull
in interface ILevel1ListElementsOperator<I,T>
execIfNotNull
in interface ExecutableElementsOperator<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 Level1ListElementsOperator<I,T> execIfNull(IFunction<? super T,? extends T> function)
ExecutableElementsOperator
Executes a function in a way equivalent to ExecutableElementsOperator.exec(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfNull
in interface ILevel1ListElementsOperator<I,T>
execIfNull
in interface ExecutableElementsOperator<T>
function
- the function to be executed on the selected elements
public <X> Level1ListElementsOperator<I,X> execIfNull(IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
ExecutableElementsOperator
Executes a function in a way equivalent to ExecutableElementsOperator.exec(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfNull
in interface ILevel1ListElementsOperator<I,T>
execIfNull
in interface ExecutableElementsOperator<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 Level1ListElementsOperator<I,T> execIfTrue(IFunction<? super T,Boolean> eval, IFunction<? super T,? extends T> function)
ExecutableElementsOperator
Executes a function in a way equivalent to ExecutableElementsOperator.exec(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfTrue
in interface ILevel1ListElementsOperator<I,T>
execIfTrue
in interface ExecutableElementsOperator<T>
eval
- the evaluation function used to select elementsfunction
- the function to be executed on the selected elements
public <X> Level1ListElementsOperator<I,X> execIfTrue(IFunction<? super T,Boolean> eval, IFunction<? super T,X> function, IFunction<? super T,X> elseFunction)
ExecutableElementsOperator
Executes a function in a way equivalent to ExecutableElementsOperator.exec(IFunction)
but only
on selected elements, leaving all other elements untouched.
execIfTrue
in interface ILevel1ListElementsOperator<I,T>
execIfTrue
in interface ExecutableElementsOperator<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 |