Interface SingleProvider<E>

Type Parameters:
E - the type of the elements a SingleProvider
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 Type
    Method
    Description
    The time complexity of this method is O(1).
    getStoredSingle(Predicate<? super E> selector)
    The time complexity of this method is O(n) if the current SingleProvider contains 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 current SingleProvider is empty or contains several elements
    • getStoredSingle

      E getStoredSingle(Predicate<? super E> selector)
      The time complexity of this method is O(n) if the current SingleProvider contains 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 current SingleProvider contains none or several elements the given selector selects