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:
ArrayMappable<E>, IndexRequestable<E>, IterableWithCopyableIterator<E>, SingleSearchable<E>, StoringRequestable<E>, StringMappable, ExtendedIterable<E>, Filterable<E>, FilteringContainerViewProvider<E>, Groupable<E>, IntervallContainerViewProvider<E>, Mappable<E>, MappingContainerViewProvider<E>, AggregationRequestable<E>, CountRequestable<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, containsAllOf, containsAllOf, containsAny, containsAnyOf, containsAnyOf, containsAsManyAs, containsEqualing, containsExactlyEqualingInSameOrder, containsExactlyInSameOrder, containsLessThan, containsMoreThan, containsNone, containsNoneOf, containsNoneOf, containsOnce, containsOne, containsOne, containsOneEqualing, containsOnly, getAverage, getAverageOrZero, getCount, getCountOf, getMax, getMaxOrZero, getMedian, getMedianOrZero, getMin, getMinOrZero, getOneBasedIndexOfFirst, getOneBasedIndexOfFirstEqualElement, getOneBasedIndexOfFirstOccurrenceOf, getOptionalStoredFirst, getOptionalStoredFirst, getStandardDeviation, getStoredByMax, getStoredByMin, getStoredFirst, getStoredFirst, getStoredFirstOfType, getStoredInGroups, getStoredLast, getStoredOfType, getStoredOne, getStoredOne, getStoredOthers, getStoredSelected, getSum, getSumOfInts, getVariance, getViewFromOneBasedStartIndex, getViewFromOneBasedStartIndexToOneBasedEndIndex, getViewOf, getViewOfStoredSelected, getViewToOneBasedEndIndex, getViewWithoutFirst, getViewWithoutFirst, getViewWithoutLast, getViewWithoutLast, isEmpty, to, toArray, toByteArray, toCharArray, toConcatenatedString, toDoubleArray, toIntArray, toLongArray, toMultiples, toNumbers, toOrderedList, toReversedList, toStringArray, toStrings, toStringWithSeparator, toStringWithSeparator, toWithOneBasedIndexMethods inherited from interface EmptinessRequestable
containsAnyMethods 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- is 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 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 extendedIterable.
-
getCount
public int getCount()- Returns:
- the number of elements of the current
CountRequestable.
-
getStoredAtOneBasedIndex
- Parameters:
oneBasedIndex-- Returns:
- the element at the given oneBasedIndex. The element can be null.
-
isMaterialized
public boolean isMaterialized()- Returns:
- true if the current
MaterializationRequestableis materialized, false otherwise.
-
iterator
-
toString
-