Interface SingleProvider<E>
- Type Parameters:
E- the type of the elements aSingleProvider
- 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 SingleProvider<E>
- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescriptionThe time complexity of this method is O(1).getStoredSingle(Predicate<? super E> selector) The time complexity of this method is O(n) if the currentSingleProvidercontains n elements.
-
Method Details
-
getStoredSingle
E getStoredSingle()The time complexity of this method is O(1).- Returns:
- the single element of the current
SingleProvider - Throws:
RuntimeException- if the currentSingleProvideris empty or contains several elements
-
getStoredSingle
The time complexity of this method is O(n) if the currentSingleProvidercontains n elements.- Parameters:
selector- can select elements, is considered not to select any element when is null- Returns:
- the one element the given selector selects from the current
SingleProvider, ignoring null elements - Throws:
RuntimeException- if the given the currentSingleProvidercontains none or several elements the given selector selects
-