Class ExtendedIterableView<E>
java.lang.Object
ch.nolix.base.datastructure.extendediterable.AbstractExtendedIterable<E>
ch.nolix.base.datastructure.extendediterableview.ExtendedIterableView<E>
- Type Parameters:
E- the type of the elements of aExtendedIterableView.
- 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
ExtendedIterableView wraps one or several given Iterables
or arrays.
A ExtendedIterableView prevents that its accessed Iterables
or arrays are mutated. A ExtendedIterableView does not prevent that
the elements of its Iterable or array are mutated.- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ExtendedIterableView<T> booleanAObjectequals aExtendedIterableViewwhen the object is aIterablethat contains exactly the same elements in the same order as theExtendedIterableView.static <T> ExtendedIterableView<T> forArray(T[] array) static <T> ExtendedIterableView<T> forArrays(T[]... arrays) static <T> ExtendedIterableView<T> forIterable(Iterable<T> iterable) static <T> ExtendedIterableView<T> forIterableAndElement(Iterable<T> iterable, T element) static <T> ExtendedIterableView<T> forIterables(Iterable<? extends T>... iterables) intgetCount()getStoredAtOneBasedIndex(int oneBasedIndex) inthashCode()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
-
createEmpty
- Type Parameters:
T- is the types the elements theExtendedIterableViewwould have.- Returns:
- an empty
ExtendedIterableView.
-
forArray
- Type Parameters:
T- is the type of the elements of the given array.- Parameters:
array-- Returns:
- a new
ExtendedIterableViewfor the given array. - Throws:
RuntimeException- if the given array is null.
-
forArrays
- Type Parameters:
T- is the type of the elements of the given arrays.- Parameters:
arrays-- Returns:
- a new
ExtendedIterableViewfor the given arrays. - Throws:
RuntimeException- if the given arrays is nullRuntimeException- if one of the given arrays is null.
-
forIterable
- Type Parameters:
T- is the type of the elements of the given iterable.- Parameters:
iterable-- Returns:
- a new
ExtendedIterableViewfor the given iterable. - Throws:
RuntimeException- if the given iterable is null.
-
forIterableAndElement
- Type Parameters:
T- is the type of the elements of the given iterable and element.- Parameters:
iterable-element-- Returns:
- a new
ExtendedIterableViewfor the given iterable and element. - Throws:
RuntimeException- if the given iterable is null.
-
forIterables
@SafeVarargs public static <T> ExtendedIterableView<T> forIterables(Iterable<? extends T>... iterables) - Type Parameters:
T- is the type of the elements of the given iterables.- Parameters:
iterables-- Returns:
- a new
ExtendedIterableViewfor the given iterables. - Throws:
RuntimeException- if the given iterables is nullRuntimeException- if one of the given iterables is null.
-
equals
AObjectequals aExtendedIterableViewwhen the object is aIterablethat contains exactly the same elements in the same order as theExtendedIterableView. -
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.
-
hashCode
-
isMaterialized
public boolean isMaterialized()- Returns:
- true if the current
MaterializationRequestableis materialized, false otherwise.
-
iterator
-
toString
-