Interface IterableByExtremumProvider<E>
- Type Parameters:
E- the type of the elements aIterableByExtremumProvider
- 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 IterableByExtremumProvider<E>
- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescription<C extends Comparable<C>>
EgetStoredByMax(Function<E, C> comparableMapper) The time complexity of this method is O(n) if the currentIterableByExtremumProvidercontains n elements.<C extends Comparable<C>>
EgetStoredByMin(Function<E, C> comparableMapper) The time complexity of this method is O(n) if the currentIterableByExtremumProvidercontains n elements.
-
Method Details
-
getStoredByMax
The time complexity of this method is O(n) if the currentIterableByExtremumProvidercontains n elements.- Type Parameters:
C- the type of theComparables the given comparableMapper maps from the elements of the currentIterableByExtremumProvider- Parameters:
comparableMapper-- Returns:
- the last (!) element with the biggest
Comparablethe given comparableMapper maps from the elements of the currentIterableByExtremumProvider, ignoring null elements - Throws:
RuntimeException- if the given comparableMapper is nullRuntimeException- if the currentIterableByExtremumProviderdoes not contain a non-null element.
-
getStoredByMin
The time complexity of this method is O(n) if the currentIterableByExtremumProvidercontains n elements.- Type Parameters:
C- the type of theComparables the given comparableMapper maps from the elements of the currentIterableByExtremumProvider- Parameters:
comparableMapper-- Returns:
- the first (!) element with the smallest
Comparablethe given comparableMapper maps from the elements of the currentIterableByExtremumProvider, ignoring null elements - Throws:
RuntimeException- if the given comparableMapper is nullRuntimeException- if the currentIterableByExtremumProviderdoes not contain a non-null element.
-