Interface IterableOrderProvider<E>
- Type Parameters:
E- the type of the elements aIterableOrderProvider
- All Known Subinterfaces:
ExtendedIterable<E>, IAppendableList<E>, IArrayList<E>, ILinkedList<E>, IMatrix<E>, IMatrixColumn<E>, IMatrixRow<E>, ISqlRecord
- All Known Implementing Classes:
AbstractExtendedIterable, ArrayExtendedIterableView, ArrayList, ExtendedIterableFilterView, ExtendedIterableIntervalView, ExtendedIterableMapperView, ExtendedIterableView, ImmutableList, IterableExtendedIterableView, LinkedList, Matrix, MatrixColumn, MatrixRow, MultiExtendedIterableView, SqlRecord
public interface IterableOrderProvider<E>
- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescription<C extends Comparable<C>>
ExtendedIterable<E> The time complexity of this method is O(n*log(n)) if the currentIterableOrderProvidercontains n elements.The time complexity of this method is O(n) if the currentIterableOrderProvidercontains n elements.
-
Method Details
-
toOrdered
The time complexity of this method is O(n*log(n)) if the currentIterableOrderProvidercontains n elements.- Type Parameters:
C- the type of theComparables the given comparableMapper returns- Parameters:
comparableMapper-- Returns:
- a new
ExtendedIterablewith the elements of the currentIterableOrderProviderordered from the smallest to the biggest element according to theComparables the given comparableMapper maps from the elements of the currentIterableOrderProvider - Throws:
RuntimeException- if the given comparableMapper is nullRuntimeException- if one of the elements of the currentIterableOrderProvideris null
-
toReversed
ExtendedIterable<E> toReversed()The time complexity of this method is O(n) if the currentIterableOrderProvidercontains n elements.- Returns:
- a new
ExtendedIterablewith the elements of the currentIterableOrderProviderin reversed order
-