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

All Known Subinterfaces:
ILevel0ArrayOperator<I,T>, ILevel0ArraySelectedOperator<I,T>, ILevel0BuildingMapOperator<I,K,V>, ILevel0ListOperator<I,T>, ILevel0ListSelectedOperator<I,T>, ILevel0MapOperator<I,K,V>, ILevel0MapSelectedOperator<I,K,V>, ILevel0SetOperator<I,T>, ILevel0SetSelectedOperator<I,T>
All Known Implementing Classes:
Level0ArrayOperator, Level0ArrayOperator, Level0ArraySelectedOperator, Level0ArraySelectedOperator, Level0BuildingMapOperator, Level0ListOperator, Level0ListOperator, Level0ListSelectedOperator, Level0ListSelectedOperator, Level0MapOperator, Level0MapOperator, Level0MapSelectedOperator, Level0MapSelectedOperator, Level0SetOperator, Level0SetOperator, Level0SetSelectedOperator, Level0SetSelectedOperator

public interface SortableOperator<T>

This interface contains methods for sorting the elements of a structure.

Since:
1.0
Author:
Daniel Fernández

Method Summary
 SortableOperator<T> sort()
           Sorts the elements of the structure according to their natural ordering.
 SortableOperator<T> sort(Comparator<? super T> comparator)
           Sorts the elements of the structure according to the order induced by the specified comparator.
 SortableOperator<T> sortBy(IFunction<? super T,?> by)
           Sorts the elements of the structure according to the result of executing the specified function.
 

Method Detail

sort

SortableOperator<T> sort()

Sorts the elements of the structure according to their natural ordering.

Returns:
an operator containing the sorted structure as target object.

sort

SortableOperator<T> sort(Comparator<? super T> comparator)

Sorts the elements of the structure according to the order induced by the specified comparator.

Parameters:
comparator - the comparator to be used.
Returns:
an operator containing the sorted structure as target object.

sortBy

SortableOperator<T> sortBy(IFunction<? super T,?> by)

Sorts the elements of the structure according to the result of executing the specified function.

Parameters:
by - the function to be executed in order to obtain the compared object
Returns:
an operator containing the sorted structure as target object.


Copyright © 2012 The OP4J team. All Rights Reserved.