Class ImmutableList<E>
java.lang.Object
ch.nolix.base.container.base.AbstractContainer<E>
ch.nolix.base.container.arraylist.AbstractExtendedContainer<E>
ch.nolix.base.container.immutablelist.ImmutableList<E>
- Type Parameters:
E- is the type of the elements of aImmutableList.
- 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>
A
ImmutableList is not mutable.- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ImmutableList<T> static <T> ImmutableList<T> fromArray(T[] array) static <T> ImmutableList<T> fromIterable(Iterable<T> iterable) static <T> ImmutableList<T> fromStream(Stream<T> stream) intgetCount()getStoredAtOneBasedIndex(int oneBasedIndex) booleaniterator()toString()static <T> ImmutableList<T> withElement(T element) static <T> ImmutableList<T> withElements(T... elements) Methods inherited from class AbstractExtendedContainer
getViewFromOneBasedStartIndexToOneBasedEndIndex, getViewOf, getViewOfStoredSelected, toOrderedListMethods inherited from class AbstractContainer
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, getViewToOneBasedEndIndex, getViewWithoutFirst, getViewWithoutFirst, getViewWithoutLast, getViewWithoutLast, isEmpty, to, toArray, toByteArray, toCharArray, toConcatenatedString, toDoubleArray, toIntArray, toLongArray, toMultiples, toNumbers, 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 type of the elements theImmutableListwould have.- Returns:
- a new empty
ImmutableList.
-
fromArray
-
fromIterable
- Type Parameters:
T-- Parameters:
iterable-- Returns:
- a new
ImmutableListwith the elements of the given iterable. - Throws:
RuntimeException- if the given iterable is null.RuntimeException- if one of the elements of the given iterable is null.
-
fromStream
- Type Parameters:
T- is the type of the elements of the given stream.- Parameters:
stream-- Returns:
- a new
ImmutableListwith the elements from the given stream. - Throws:
RuntimeException- if the given stream is null.RuntimeException- if one of the elements of the given stream is null.
-
withElement
- Type Parameters:
T- is the type of the given element.- Parameters:
element-- Returns:
- a new
ImmutableListwith the given element. - Throws:
RuntimeException- if the given element is null.
-
withElements
- Type Parameters:
T- is the type of the given elements.- Parameters:
elements-- Returns:
- a new
ImmutableListwith the given elements. - Throws:
RuntimeException- if the given elements is null.RuntimeException- if one of the given elements is null.
-
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
-