Interface IndexRequestable<E>

Type Parameters:
E - is the type of the elements a IndexRequestable.
All Known Subinterfaces:
IArrayList<E>, IContainer<E>, ILinkedList<E>, IMatrix<E>, IMatrixColumn<E>, IMatrixRow<E>, ISqlRecord
All Known Implementing Classes:
AbstractContainer, AbstractExtendedContainer, ArrayContainerView, ArrayList, ContainerView, FilterContainerView, ImmutableList, IntervallContainerView, IterableContainerView, LinkedList, MappingContainerView, Matrix, MatrixColumn, MatrixRow, MultiContainerView, SingleContainer, 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.