org.op4j.operators.qualities
Interface ModifiableCollectionOperator<T>

All Known Subinterfaces:
ILevel0ArrayOperator<I,T>, ILevel0ArraySelectedOperator<I,T>, ILevel0ListOperator<I,T>, ILevel0ListSelectedOperator<I,T>, ILevel0SetOperator<I,T>, ILevel0SetSelectedOperator<I,T>
All Known Implementing Classes:
Level0ArrayOperator, Level0ArrayOperator, Level0ArraySelectedOperator, Level0ArraySelectedOperator, Level0ListOperator, Level0ListOperator, Level0ListSelectedOperator, Level0ListSelectedOperator, Level0SetOperator, Level0SetOperator, Level0SetSelectedOperator, Level0SetSelectedOperator

public interface ModifiableCollectionOperator<T>

This interface contains methods for modifying structures (adding/removing elements).

Since:
1.0
Author:
Daniel Fernández

Method Summary
 ModifiableCollectionOperator<T> add(T newElement)
           Adds the specified element at the end of the target structure object.
 ModifiableCollectionOperator<T> addAll(Collection<T> collection)
           Adds all the elements in the specified collection to the target structure object.
 ModifiableCollectionOperator<T> addAll(T... newElements)
           Adds all the specified elements at the end of the target structure object.
 ModifiableCollectionOperator<T> insert(int position, T newElement)
           Inserts a new element into the specified position (starting in 0) of the target structure object.
 ModifiableCollectionOperator<T> insertAll(int position, T... newElements)
           Inserts new elements into the specified position (starting in 0) of the target structure object.
 ModifiableCollectionOperator<T> removeAllEqual(T... values)
           Removes the specified values from the target structure object.
 ModifiableCollectionOperator<T> removeAllFalse(IFunction<? super T,Boolean> eval)
           Removes from the target structure object all the elements which evaluate as false using the specified evaluator.
 ModifiableCollectionOperator<T> removeAllIndexes(int... indexes)
           Removes all the elements in the target structure object which position (index) in it matches one the specified indexes.
 ModifiableCollectionOperator<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.
 ModifiableCollectionOperator<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.
 ModifiableCollectionOperator<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.
 ModifiableCollectionOperator<T> removeAllNull()
           Remove all the null elements in the target structure object.
 ModifiableCollectionOperator<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.
 ModifiableCollectionOperator<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.
 ModifiableCollectionOperator<T> removeAllTrue(IFunction<? super T,Boolean> eval)
           Removes from the target structure object all the elements which evaluate as true using the specified evaluator.
 

Method Detail

add

ModifiableCollectionOperator<T> add(T newElement)

Adds the specified element at the end of the target structure object.

The original target object is not modified, but copied instead.

Parameters:
newElement - the element to be added
Returns:
an operator holding the modified target object

addAll

ModifiableCollectionOperator<T> addAll(T... newElements)

Adds all the specified elements at the end of the target structure object.

The original target object is not modified, but copied instead.

Parameters:
newElements - the elements to be added
Returns:
an operator holding the modified target object

insert

ModifiableCollectionOperator<T> insert(int position,
                                       T newElement)

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.

Parameters:
position - the position in which the new element will be inserted (starting in 0)
newElement - the element to be inserted
Returns:
an operator holding the modified target object

insertAll

ModifiableCollectionOperator<T> insertAll(int position,
                                          T... newElements)

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.

Parameters:
position - the position in which the new element will be inserted (starting in 0)
newElements - the elements to be inserted
Returns:
an operator holding the modified target object

addAll

ModifiableCollectionOperator<T> addAll(Collection<T> collection)

Adds all the elements in the specified collection to the target structure object.

The original target object is not modified, but copied instead.

Parameters:
collection - the collection containing the elements to be added
Returns:
an operator holding the modified target object

removeAllIndexes

ModifiableCollectionOperator<T> removeAllIndexes(int... indexes)

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.

Parameters:
indexes - the positions of the elements to be removed
Returns:
an operator holding the modified target object

removeAllEqual

ModifiableCollectionOperator<T> removeAllEqual(T... values)

Removes the specified values from the target structure object.

The original target object is not modified, but copied instead.

Parameters:
values - the values to be removed from the target.
Returns:
an operator holding the modified target object

removeAllTrue

ModifiableCollectionOperator<T> removeAllTrue(IFunction<? super T,Boolean> eval)

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.

Parameters:
eval - the evaluator to be used, which must return Boolean
Returns:
an operator holding the modified target object

removeAllFalse

ModifiableCollectionOperator<T> removeAllFalse(IFunction<? super T,Boolean> eval)

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.

Parameters:
eval - the evaluator to be used, which must return Boolean
Returns:
an operator holding the modified target object

removeAllNullOrFalse

ModifiableCollectionOperator<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.

The original target object is not modified, but copied instead.

Parameters:
eval - the evaluator to be used, which must return Boolean
Returns:
an operator holding the modified target object

removeAllNotNullAndFalse

ModifiableCollectionOperator<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.

The original target object is not modified, but copied instead.

Parameters:
eval - the evaluator to be used, which must return Boolean
Returns:
an operator holding the modified target object

removeAllNotNullAndTrue

ModifiableCollectionOperator<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.

The original target object is not modified, but copied instead.

Parameters:
eval - the evaluator to be used, which must return Boolean
Returns:
an operator holding the modified target object

removeAllNullOrTrue

ModifiableCollectionOperator<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.

The original target object is not modified, but copied instead.

Parameters:
eval - the evaluator to be used, which must return Boolean
Returns:
an operator holding the modified target object

removeAllIndexesNot

ModifiableCollectionOperator<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.

The original target object is not modified, but copied instead.

Parameters:
indexes - the positions of the elements to be kept
Returns:
an operator holding the modified target object

removeAllNull

ModifiableCollectionOperator<T> removeAllNull()

Remove all the null elements in the target structure object.

The original target object is not modified, but copied instead.

Returns:
an operator holding the modified target object


Copyright © 2012 The OP4J team. All Rights Reserved.