Interface IterableIntervalViewProvider<E>
- Type Parameters:
E- the type of the elements of aIterableIntervalViewProvider
- 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 IterableIntervalViewProvider<E>
- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescriptiongetViewFromOneBasedStartIndex(int oneBasedStartIndex) getViewFromOneBasedStartIndexToOneBasedEndIndex(int oneBasedStartIndex, int oneBasedEndIndex) getViewToOneBasedEndIndex(int oneBasedEndIndex) getViewWithoutFirst(int n) getViewWithoutLast(int n)
-
Method Details
-
getViewFromOneBasedStartIndex
- Parameters:
oneBasedStartIndex-- Returns:
- a new view of the current
IterableIntervalViewProviderfrom the given oneBasedStartIndex - Throws:
RuntimeException- if the given oneBasedStartIndex is bigger than the number of elements of the currentExtendedIterable.
-
getViewFromOneBasedStartIndexToOneBasedEndIndex
ExtendedIterable<E> getViewFromOneBasedStartIndexToOneBasedEndIndex(int oneBasedStartIndex, int oneBasedEndIndex) - Parameters:
oneBasedStartIndex-oneBasedEndIndex-- Returns:
- a new view of the current
IterableIntervalViewProviderfrom the given oneBasedStartIndex to the given oneBasedEndIndex - Throws:
RuntimeException- if the given oneBasedStartIndex is not positiveRuntimeException- if the given oneBasedStartIndex is smaller than the given oneBasedEndIndexRuntimeException- if the given oneBasedEndIndex is bigger than the number of elements of the currentExtendedIterable.
-
getViewToOneBasedEndIndex
- Parameters:
oneBasedEndIndex-- Returns:
- a new view
ExtendedIterableof the currentIterableIntervalViewProviderto the given oneBasedEndIndex - Throws:
RuntimeException- if the given oneBasedEndIndex is not positiveRuntimeException- if the given oneBasedEndIndex is bigger than the number of the elements of the currentExtendedIterable.
-
getViewWithoutFirst
ExtendedIterable<E> getViewWithoutFirst()- Returns:
- a new view
ExtendedIterableview of the currentIterableIntervalViewProviderwithout the first element - Throws:
RuntimeException- if the currentIterableIntervalViewProvideris empty
-
getViewWithoutFirst
- Parameters:
n-- Returns:
- a new view
ExtendedIterableview of the currentIterableIntervalViewProviderwithout the first n elements - Throws:
RuntimeException- if the given n is negative
-
getViewWithoutLast
ExtendedIterable<E> getViewWithoutLast()- Returns:
- a new view
ExtendedIterableview of the currentIterableIntervalViewProviderwithout the last element - Throws:
RuntimeException- if the currentIterableIntervalViewProvideris empty
-
getViewWithoutLast
- Parameters:
n-- Returns:
- a new view
ExtendedIterableof the currentIterableIntervalViewProviderwithout the last n elements - Throws:
RuntimeException- if the given n is negative
-