Interface IndexRequestable<E>

Type Parameters:
E - the type of the elements a IndexRequestable.
All Known Subinterfaces:
ExtendedIterable<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 IndexRequestable<E>
Author:
Silvan Wyss
  • Method Details

    • getOneBasedIndexOfFirst

      int getOneBasedIndexOfFirst(Predicate<E> selector)
      Parameters:
      selector -
      Returns:
      the 1-based index of the first element the given selector selects from the current IndexRequestable. Ignores null elements.
      Throws:
      RuntimeException - if the given selector is null
      RuntimeException - if the current IndexRequestable does not contain an element the given selector selects.
    • getOneBasedIndexOfFirstEqualElement

      int getOneBasedIndexOfFirstEqualElement(Object object)
      Parameters:
      object -
      Returns:
      the 1-based index of the first element of the current IndexRequestable that equals the given object.
      Throws:
      RuntimeException - if the current IndexRequestable does not contain an element that equals the given object.
    • getOneBasedIndexOfFirstOccurrenceOf

      int getOneBasedIndexOfFirstOccurrenceOf(Object object)
      Parameters:
      object -
      Returns:
      the 1-based index of the first occurrence of the given object in the current IndexRequestable.
      Throws:
      RuntimeException - if the current IndexRequestable does not contain the given object.