Class ExtendedIterableIntervalView<E>
java.lang.Object
ch.nolix.base.datastructure.extendediterable.AbstractExtendedIterable<E>
ch.nolix.base.datastructure.extendediterableintervalview.ExtendedIterableIntervalView<E>
- Type Parameters:
E- the type of the elements of aExtendedIterableIntervalView
- All Implemented Interfaces:
IterableWithCopyableIterator<E>, ExtendedIterable<E>, IterableFilterProvider<E>, IterableFilterViewProvider<E>, IterableGroupProvider<E>, IterableIntervalViewProvider<E>, IterableMappedProvider<E>, IterableMappedViewProvider<E>, IterableOrderProvider<E>, IterableArrayProvider<E>, IterableByExtremumProvider<E>, IterableByIndexProvider<E>, IterableFirstProvider<E>, IterableLastProvider<E>, IterableStringProvider, IterableContainAnyRequestable, IterableContainEqualRequestable<E>, IterableContainMatchingRequestable<E>, IterableContainMultipleRequestable, IterableContainObjectRequestable, IterableOneBasedIndexRequestable<E>, AggregationRequestable<E>, BaseCountRequestable, CountRequestable<E>, SingleProvider<E>, EmptinessRequestable, MaterializationRequestable, Iterable<E>
A
ExtendedIterableIntervalView can iterate over an intervall of a
ExtendedIterable.- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ExtendedIterableIntervalView<T> forExtendedIterableAndStartIndexAndEndIndex(ExtendedIterable<T> extendedIterable, int startIndex, int endIndex) intgetCount()getStoredAtOneBasedIndex(int oneBasedIndex) booleaniterator()toString()Methods inherited from class AbstractExtendedIterable
contains, containsAll, containsAll, containsAny, containsAny, containsAny, containsEqual, containsExactlyAllEqualInSameOrder, containsExactlyInSameOrder, containsMatching, containsMatchingOnly, containsNoEqual, containsNoMatching, containsNone, containsNone, containsNonNull, containsOnce, containsOne, containsOneEqual, containsOneMatching, containsOneNoneNull, containsOnly, getAverage, getAverageOrZero, getCount, getCountOf, getMax, getMaxOrZero, getMedian, getMedianOrZero, getMin, getMinOrZero, getOneBasedIndexOfFirst, getOneBasedIndexOfFirstEqualElement, getOneBasedIndexOfFirstOccurrenceOf, getOptionalStoredFirst, getOptionalStoredFirst, getStandardDeviation, getStoredByMax, getStoredByMin, getStoredFirst, getStoredFirst, getStoredFirstNonNull, getStoredFirstOfType, getStoredInGroups, getStoredLast, getStoredOfType, getStoredOthers, getStoredSelected, getStoredSingle, getStoredSingle, getSum, getSumOfInts, getVariance, getViewFromOneBasedStartIndex, getViewFromOneBasedStartIndexToOneBasedEndIndex, getViewOf, getViewOfStoredSelected, getViewToOneBasedEndIndex, getViewWithoutFirst, getViewWithoutFirst, getViewWithoutLast, getViewWithoutLast, isEmpty, to, toArray, toByteArray, toCharArray, toConcatenatedString, toDoubleArray, toIntArray, toLongArray, toMultiples, toNumbers, toOrdered, toReversed, toStringArray, toStrings, toStringWithDelimiter, toStringWithDelimiter, toWithOneBasedIndexMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface MaterializationRequestable
isView
-
Method Details
-
forExtendedIterableAndStartIndexAndEndIndex
public static <T> ExtendedIterableIntervalView<T> forExtendedIterableAndStartIndexAndEndIndex(ExtendedIterable<T> extendedIterable, int startIndex, int endIndex) - Type Parameters:
T- the type of the elements of the createdExtendedIterableIntervalView- Parameters:
extendedIterable-startIndex-endIndex-- Returns:
- a new
ExtendedIterableIntervalViewwith the given extendedIterable, startIndex and endIndex - Throws:
RuntimeException- if the given extendedIterable is nullRuntimeException- if the given startIndex is not positiveRuntimeException- if the given endIndex is not positiveRuntimeException- if the given endIndex is smaller than the given startIndexRuntimeException- if the given endIndex is bigger than the number of elements of the given extendedIterable.
-
getCount
public int getCount()- Returns:
- the number of elements of the current
BaseCountRequestable
-
getStoredAtOneBasedIndex
- Parameters:
oneBasedIndex-- Returns:
- the element at the given oneBasedIndex from the current
IterableByIndexProvider
-
isMaterialized
public boolean isMaterialized()- Returns:
- true if the current
MaterializationRequestableis materialized, false otherwise
-
iterator
-
toString
-