Class IntervallContainerView<E>

Type Parameters:
E - is the type of the elements of a IntervallContainerView.
All Implemented Interfaces:
Filterable<E>, Groupable<E>, IContainer<E>, IFilteringContainerViewProvider<E>, IIntervallContainerViewProvider<E>, IMappingContainerViewProvider<E>, Mappable<E>, AggregationRequestable<E>, ArrayMappable<E>, CountRequestable<E>, IndexRequestable<E>, IterableWithCopyableIterator<E>, SingleSearchable<E>, StoringRequestable<E>, StringMappable, EmptinessRequestable, MaterializationRequestable, Iterable<E>

public final class IntervallContainerView<E> extends AbstractExtendedContainer<E>
A IntervallContainerView can iterate over a part of another container. A IntervallContainerView must not use the methods of the accessed container except the iterator method. The reason is that the accessed container can be a specialized container that does not use its iterator in any of its declared or overwritten method.
Author:
Silvan Wyss
  • Method Details

    • forContainerAndStartIndexAndEndIndex

      public static <T> IntervallContainerView<T> forContainerAndStartIndexAndEndIndex(AbstractContainer<T> container, int startIndex, int endIndex)
      Type Parameters:
      T - is the type of the elements of the created IntervallContainerView.
      Parameters:
      container -
      startIndex -
      endIndex -
      Returns:
      a new IntervallContainerView with the given container, startIndex and endIndex.
      Throws:
      RuntimeException - if the given container is null.
      RuntimeException - if the given startIndex is not positive.
      RuntimeException - if the given endIndex is not positive.
      RuntimeException - if the given endIndex is smaller than the given startIndex.
      RuntimeException - if the given endIndex is bigger than the number of elements of the given container.
    • getCount

      public int getCount()
      Returns:
      the number of elements of the current CountRequestable.
    • getStoredAtOneBasedIndex

      public E getStoredAtOneBasedIndex(int oneBasedIndex)
      Parameters:
      oneBasedIndex -
      Returns:
      the element at the given oneBasedIndex. The element can be null.
    • isMaterialized

      public boolean isMaterialized()
      Returns:
      true if the current MaterializationRequestable is materialized, false otherwise.
    • iterator

      public CopyableIterator<E> iterator()
    • toString

      public String toString()
      Overrides:
      toString in class Object