|
||||||||||
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.set.Level0SetSelectedOperator<I,T>
public final class Level0SetSelectedOperator<I,T>
Constructor Summary | |
---|---|
Level0SetSelectedOperator(Target target)
|
Method Summary | |
---|---|
Level0SetSelectedOperator<I,T> |
add(T newElement)
Adds the specified element at the end of the target structure object. |
Level0SetSelectedOperator<I,T> |
addAll(Collection<T> collection)
Adds all the elements in the specified collection to the target structure object. |
Level0SetSelectedOperator<I,T> |
addAll(T... newElements)
Adds all the specified elements at the end of the target structure object. |
Level0SetOperator<I,T> |
endIf()
Ends the selection currently active for this level. |
Level0SetSelectedOperator<I,T> |
execAsSet(IFunction<? super Set<T>,? extends Set<? extends T>> function)
Executes the specified function on the target set, creating a new set operator containing the result of the execution. |
Level1SetSelectedElementsOperator<I,T> |
forEach()
Iterates the target collection. |
Function<I,Set<T>> |
get()
Returns a function which will execute all the logic specified from the "Fn.on" expression. |
Level0SetSelectedOperator<I,T> |
insert(int position,
T newElement)
Inserts a new element into the specified position (starting in 0) of the target structure object. |
Level0SetSelectedOperator<I,T> |
insertAll(int position,
T... newElements)
Inserts new elements into the specified position (starting in 0) of the target structure object. |
Level0SetSelectedOperator<I,T> |
map(IFunction<? super T,? extends T> function)
Executes the specified function on each of the elements, creating a new set operator containing the result of all the executions. |
Level0SetSelectedOperator<I,T> |
removeAllEqual(T... values)
Removes the specified values from the target structure object. |
Level0SetSelectedOperator<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. |
Level0SetSelectedOperator<I,T> |
removeAllIndexes(int... indexes)
Removes all the elements in the target structure object which position (index) in it matches one the specified indexes. |
Level0SetSelectedOperator<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. |
Level0SetSelectedOperator<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. |
Level0SetSelectedOperator<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. |
Level0SetSelectedOperator<I,T> |
removeAllNull()
Remove all the null elements in the target structure object. |
Level0SetSelectedOperator<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. |
Level0SetSelectedOperator<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. |
Level0SetSelectedOperator<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. |
Level0SetSelectedOperator<I,T> |
replaceWith(Set<T> replacement)
Replaces the current target object with the specified replacement. |
Level0SetSelectedOperator<I,T> |
sort()
Sorts the elements of the structure according to their natural ordering. |
Level0SetSelectedOperator<I,T> |
sort(Comparator<? super T> comparator)
Sorts the elements of the structure according to the order induced by the specified comparator. |
Level0SetSelectedOperator<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 Level0SetSelectedOperator(Target target)
Method Detail |
---|
public Level1SetSelectedElementsOperator<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 ILevel0SetSelectedOperator<I,T>
forEach
in interface NavigableCollectionOperator<T>
public Level0SetSelectedOperator<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 ILevel0SetSelectedOperator<I,T>
sortBy
in interface SortableOperator<T>
by
- the function to be executed in order to obtain the compared object
public Level0SetSelectedOperator<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 ILevel0SetSelectedOperator<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 Level0SetSelectedOperator<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 ILevel0SetSelectedOperator<I,T>
removeAllIndexes
in interface ModifiableCollectionOperator<T>
indexes
- the positions of the elements to be removed
public Level0SetSelectedOperator<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 ILevel0SetSelectedOperator<I,T>
removeAllEqual
in interface ModifiableCollectionOperator<T>
values
- the values to be removed from the target.
public Level0SetSelectedOperator<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 ILevel0SetSelectedOperator<I,T>
removeAllTrue
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0SetSelectedOperator<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 ILevel0SetSelectedOperator<I,T>
removeAllFalse
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0SetSelectedOperator<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 ILevel0SetSelectedOperator<I,T>
removeAllNullOrFalse
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0SetSelectedOperator<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 ILevel0SetSelectedOperator<I,T>
removeAllNotNullAndFalse
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0SetSelectedOperator<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 ILevel0SetSelectedOperator<I,T>
removeAllNotNullAndTrue
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0SetSelectedOperator<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 ILevel0SetSelectedOperator<I,T>
removeAllNullOrTrue
in interface ModifiableCollectionOperator<T>
eval
- the evaluator to be used, which must return Boolean
public Level0SetSelectedOperator<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 ILevel0SetSelectedOperator<I,T>
removeAllIndexesNot
in interface ModifiableCollectionOperator<T>
indexes
- the positions of the elements to be kept
public Level0SetSelectedOperator<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 ILevel0SetSelectedOperator<I,T>
removeAllNull
in interface ModifiableCollectionOperator<T>
public Level0SetOperator<I,T> endIf()
SelectedOperator
Ends the selection currently active for this level.
endIf
in interface ILevel0SetSelectedOperator<I,T>
endIf
in interface SelectedOperator<Set<T>>
public Level0SetSelectedOperator<I,T> execAsSet(IFunction<? super Set<T>,? extends Set<? extends T>> function)
ExecutableSetSelectedOperator
Executes the specified function on the target set, creating a new set 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).
execAsSet
in interface ILevel0SetSelectedOperator<I,T>
execAsSet
in interface ExecutableSetSelectedOperator<T>
function
- the function to be executed
public Level0SetSelectedOperator<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 ILevel0SetSelectedOperator<I,T>
add
in interface ModifiableCollectionOperator<T>
newElement
- the element to be added
public Level0SetSelectedOperator<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 ILevel0SetSelectedOperator<I,T>
addAll
in interface ModifiableCollectionOperator<T>
newElements
- the elements to be added
public Level0SetSelectedOperator<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 ILevel0SetSelectedOperator<I,T>
addAll
in interface ModifiableCollectionOperator<T>
collection
- the collection containing the elements to be added
public Level0SetSelectedOperator<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 ILevel0SetSelectedOperator<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 Level0SetSelectedOperator<I,T> sort()
SortableOperator
Sorts the elements of the structure according to their natural ordering.
sort
in interface ILevel0SetSelectedOperator<I,T>
sort
in interface SortableOperator<T>
public Level0SetSelectedOperator<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 ILevel0SetSelectedOperator<I,T>
sort
in interface SortableOperator<T>
comparator
- the comparator to be used.
public Level0SetSelectedOperator<I,T> map(IFunction<? super T,? extends T> function)
ExecutableSetSelectedOperator
Executes the specified function on each of the elements, creating a new set 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 ILevel0SetSelectedOperator<I,T>
map
in interface ExecutableSetSelectedOperator<T>
function
- the function to be executed
public Level0SetSelectedOperator<I,T> replaceWith(Set<T> replacement)
ReplaceableOperator
Replaces the current target object with the specified replacement.
replaceWith
in interface ILevel0SetSelectedOperator<I,T>
replaceWith
in interface ReplaceableOperator<Set<T>>
replacement
- the object which will replace the current target object.
public Function<I,Set<T>> get()
UniqFnOperator
Returns a function which will execute all the logic specified from the "Fn.on" expression.
get
in interface UniqFnOperator<I,Set<T>>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |