|
||||||||||
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.list.Level0ListSelectedOperator<I,T>
public final class Level0ListSelectedOperator<I,T>
Constructor Summary | |
---|---|
Level0ListSelectedOperator(Target target)
|
Method Summary | |
---|---|
Level0ListSelectedOperator<I,T> |
add(T newElement)
Adds the specified element at the end of the target structure object. |
Level0ListSelectedOperator<I,T> |
addAll(Collection<T> collection)
Adds all the elements in the specified collection to the target structure object. |
Level0ListSelectedOperator<I,T> |
addAll(T... newElements)
Adds all the specified elements at the end of the target structure object. |
Level0ListSelectedOperator<I,T> |
distinct()
Removes all duplicate elements from the target collection or array. |
Level0ListOperator<I,T> |
endIf()
Ends the selection currently active for this level. |
Level0ListSelectedOperator<I,T> |
execAsList(IFunction<? super List<T>,? extends List<? extends T>> function)
Executes the specified function on the target object, creating a new list operator containing the result of the execution. |
Level1ListSelectedElementsOperator<I,T> |
forEach()
Iterates the target collection. |
Function<I,List<T>> |
get()
Returns a function which will execute all the logic specified from the "Fn.on" expression. |
Level0ListSelectedOperator<I,T> |
insert(int position,
T newElement)
Inserts a new element into the specified position (starting in 0) of the target structure object. |
Level0ListSelectedOperator<I,T> |
insertAll(int position,
T... newElements)
Inserts new elements into the specified position (starting in 0) of the target structure object. |
Level0ListSelectedOperator<I,T> |
map(IFunction<? super T,? extends T> function)
Executes the specified function on each of the elements, creating a new list operator containing the result of all the executions. |
Level0ListSelectedOperator<I,T> |
removeAllEqual(T... values)
Removes the specified values from the target structure object. |
Level0ListSelectedOperator<I,T> |
removeAllFalse(IFunction<? super T,Boolean> eval)
Removes from the target structure object all the elements which evaluate as false using the specified evaluator. |
Level0ListSelectedOperator<I,T> |
removeAllIndexes(int... indexes)
Removes all the elements in the target structure object which position (index) in it matches one the specified indexes. |
Level0ListSelectedOperator<I,T> |
removeAllIndexesNot(int... indexes)
Removes all the elements in the target structure object except those which position (index) in it matches one of the specified indexes. |
Level0ListSelectedOperator<I,T> |
removeAllNotNullAndFalse(IFunction<? super T,Boolean> eval)
Removes from the target structure object all the elements which are not null and evaluate as false using the specified evaluator. |
Level0ListSelectedOperator<I,T> |
removeAllNotNullAndTrue(IFunction<? super T,Boolean> eval)
Removes from the target structure object all the elements which are not null and evaluate as true using the specified evaluator. |
Level0ListSelectedOperator<I,T> |
removeAllNull()
Remove all the null elements in the target structure object. |
Level0ListSelectedOperator<I,T> |
removeAllNullOrFalse(IFunction<? super T,Boolean> eval)
Removes from the target structure object all the elements which either are null or evaluate as false using the specified evaluator. |
Level0ListSelectedOperator<I,T> |
removeAllNullOrTrue(IFunction<? super T,Boolean> eval)
Removes from the target structure object all the elements which either are null or evaluate as true using the specified evaluator. |
Level0ListSelectedOperator<I,T> |
removeAllTrue(IFunction<? super T,Boolean> eval)
Removes from the target structure object all the elements which evaluate as true using the specified evaluator. |
Level0ListSelectedOperator<I,T> |
replaceWith(List<T> replacement)
Replaces the current target object with the specified replacement. |
Level0ListSelectedOperator<I,T> |
sort()
Sorts the elements of the structure according to their natural ordering. |
Level0ListSelectedOperator<I,T> |
sort(Comparator<? super T> comparator)
Sorts the elements of the structure according to the order induced by the specified comparator. |
Level0ListSelectedOperator<I,T> |
sortBy(IFunction<? super T,?> by)
Sorts the elements of the structure according to the result of executing the specified function. |
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 Level0ListSelectedOperator(Target target)
Method Detail |
---|
public Level1ListSelectedElementsOperator<I,T> forEach()
NavigableCollectionOperator
Iterates the target collection. After executing this method, any further operations will be applied on each of the collection elements until an "endFor()" method is called.
forEach
in interface ILevel0ListSelectedOperator<I,T>
forEach
in interface NavigableCollectionOperator<T>
public Level0ListSelectedOperator<I,T> distinct()
DistinguishableOperator
Removes all duplicate elements from the target collection or array.
distinct
in interface ILevel0ListSelectedOperator<I,T>
distinct
in interface DistinguishableOperator
public Level0ListSelectedOperator<I,T> sortBy(IFunction<? super T,?> by)
SortableOperator
Sorts the elements of the structure according to the result of executing the specified function.
sortBy
in interface ILevel0ListSelectedOperator<I,T>
sortBy
in interface SortableOperator<T>
by
- the function to be executed in order to obtain the compared object
public Level0ListSelectedOperator<I,T> insertAll(int position, T... newElements)
ModifiableCollectionOperator
Inserts new elements into the specified position (starting in 0) of the target structure object.
The original target object is not modified, but copied instead.
insertAll
in interface ILevel0ListSelectedOperator<I,T>
insertAll
in interface ModifiableCollectionOperator<T>
position
- the position in which the new element will be inserted (starting in 0)newElements
- the elements to be inserted
public Level0ListSelectedOperator<I,T> removeAllIndexes(int... indexes)
ModifiableCollectionOperator
Removes all the elements in the target structure object which position (index) in it matches one the specified indexes.
The original target object is not modified, but copied instead.
removeAllIndexes
in interface ILevel0ListSelectedOperator<I,T>
removeAllIndexes
in interface ModifiableCollectionOperator<T>
indexes
- the positions of the elements to be removed
public Level0ListSelectedOperator<I,T> removeAllEqual(T... values)
ModifiableCollectionOperator
Removes the specified values from the target structure object.
The original target object is not modified, but copied instead.
removeAllEqual
in interface ILevel0ListSelectedOperator<I,T>
removeAllEqual
in interface ModifiableCollectionOperator<T>
values
- the values to be removed from the target.
public Level0ListSelectedOperator<I,T> removeAllTrue(IFunction<? super T,Boolean> eval)
ModifiableCollectionOperator
Removes from the target structure object all the elements which evaluate as true using the specified evaluator.
The original target object is not modified, but copied instead.
removeAllTrue
in interface ILevel0ListSelectedOperator<I,T>
removeAllTrue
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0ListSelectedOperator<I,T> removeAllFalse(IFunction<? super T,Boolean> eval)
ModifiableCollectionOperator
Removes from the target structure object all the elements which evaluate as false using the specified evaluator.
The original target object is not modified, but copied instead.
removeAllFalse
in interface ILevel0ListSelectedOperator<I,T>
removeAllFalse
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0ListSelectedOperator<I,T> removeAllNullOrFalse(IFunction<? super T,Boolean> eval)
ModifiableCollectionOperator
Removes from the target structure object all the elements which either are null or evaluate as false using the specified evaluator.
The original target object is not modified, but copied instead.
removeAllNullOrFalse
in interface ILevel0ListSelectedOperator<I,T>
removeAllNullOrFalse
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0ListSelectedOperator<I,T> removeAllNotNullAndFalse(IFunction<? super T,Boolean> eval)
ModifiableCollectionOperator
Removes from the target structure object all the elements which are not null and evaluate as false using the specified evaluator.
The original target object is not modified, but copied instead.
removeAllNotNullAndFalse
in interface ILevel0ListSelectedOperator<I,T>
removeAllNotNullAndFalse
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0ListSelectedOperator<I,T> removeAllNotNullAndTrue(IFunction<? super T,Boolean> eval)
ModifiableCollectionOperator
Removes from the target structure object all the elements which are not null and evaluate as true using the specified evaluator.
The original target object is not modified, but copied instead.
removeAllNotNullAndTrue
in interface ILevel0ListSelectedOperator<I,T>
removeAllNotNullAndTrue
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0ListSelectedOperator<I,T> removeAllNullOrTrue(IFunction<? super T,Boolean> eval)
ModifiableCollectionOperator
Removes from the target structure object all the elements which either are null or evaluate as true using the specified evaluator.
The original target object is not modified, but copied instead.
removeAllNullOrTrue
in interface ILevel0ListSelectedOperator<I,T>
removeAllNullOrTrue
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0ListSelectedOperator<I,T> removeAllIndexesNot(int... indexes)
ModifiableCollectionOperator
Removes all the elements in the target structure object except those which position (index) in it matches one of the specified indexes.
The original target object is not modified, but copied instead.
removeAllIndexesNot
in interface ILevel0ListSelectedOperator<I,T>
removeAllIndexesNot
in interface ModifiableCollectionOperator<T>
indexes
- the positions of the elements to be kept
public Level0ListSelectedOperator<I,T> removeAllNull()
ModifiableCollectionOperator
Remove all the null elements in the target structure object.
The original target object is not modified, but copied instead.
removeAllNull
in interface ILevel0ListSelectedOperator<I,T>
removeAllNull
in interface ModifiableCollectionOperator<T>
public Level0ListOperator<I,T> endIf()
SelectedOperator
Ends the selection currently active for this level.
endIf
in interface ILevel0ListSelectedOperator<I,T>
endIf
in interface SelectedOperator<List<T>>
public Level0ListSelectedOperator<I,T> execAsList(IFunction<? super List<T>,? extends List<? extends T>> function)
ExecutableListSelectedOperator
Executes the specified function on the target object, creating a new list operator containing the result of the execution.
This function does not allow the operator target type to change because a selection ("if") has already been done on the target objects, and this would render the operator inconsistent (some objects would belong to a type and others to another type).
execAsList
in interface ILevel0ListSelectedOperator<I,T>
execAsList
in interface ExecutableListSelectedOperator<T>
function
- the function to be executed
public Level0ListSelectedOperator<I,T> add(T newElement)
ModifiableCollectionOperator
Adds the specified element at the end of the target structure object.
The original target object is not modified, but copied instead.
add
in interface ILevel0ListSelectedOperator<I,T>
add
in interface ModifiableCollectionOperator<T>
newElement
- the element to be added
public Level0ListSelectedOperator<I,T> addAll(T... newElements)
ModifiableCollectionOperator
Adds all the specified elements at the end of the target structure object.
The original target object is not modified, but copied instead.
addAll
in interface ILevel0ListSelectedOperator<I,T>
addAll
in interface ModifiableCollectionOperator<T>
newElements
- the elements to be added
public Level0ListSelectedOperator<I,T> addAll(Collection<T> collection)
ModifiableCollectionOperator
Adds all the elements in the specified collection to the target structure object.
The original target object is not modified, but copied instead.
addAll
in interface ILevel0ListSelectedOperator<I,T>
addAll
in interface ModifiableCollectionOperator<T>
collection
- the collection containing the elements to be added
public Level0ListSelectedOperator<I,T> insert(int position, T newElement)
ModifiableCollectionOperator
Inserts a new element into the specified position (starting in 0) of the target structure object.
The original target object is not modified, but copied instead.
insert
in interface ILevel0ListSelectedOperator<I,T>
insert
in interface ModifiableCollectionOperator<T>
position
- the position in which the new element will be inserted (starting in 0)newElement
- the element to be inserted
public Level0ListSelectedOperator<I,T> sort()
SortableOperator
Sorts the elements of the structure according to their natural ordering.
sort
in interface ILevel0ListSelectedOperator<I,T>
sort
in interface SortableOperator<T>
public Level0ListSelectedOperator<I,T> sort(Comparator<? super T> comparator)
SortableOperator
Sorts the elements of the structure according to the order induced by the specified comparator.
sort
in interface ILevel0ListSelectedOperator<I,T>
sort
in interface SortableOperator<T>
comparator
- the comparator to be used.
public Level0ListSelectedOperator<I,T> map(IFunction<? super T,? extends T> function)
ExecutableListSelectedOperator
Executes the specified function on each of the elements, creating a new list operator containing the result of all the executions.
This function does not allow the operator target type to change because a selection ("if") has already been done on the target objects, and this would render the operator inconsistent (some objects would belong to a type and others to another type).
This method is equivalent to forEach().exec(function).endFor().
map
in interface ILevel0ListSelectedOperator<I,T>
map
in interface ExecutableListSelectedOperator<T>
function
- the function to be executed
public Level0ListSelectedOperator<I,T> replaceWith(List<T> replacement)
ReplaceableOperator
Replaces the current target object with the specified replacement.
replaceWith
in interface ILevel0ListSelectedOperator<I,T>
replaceWith
in interface ReplaceableOperator<List<T>>
replacement
- the object which will replace the current target object.
public Function<I,List<T>> get()
UniqFnOperator
Returns a function which will execute all the logic specified from the "Fn.on" expression.
get
in interface UniqFnOperator<I,List<T>>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |