public class OneDimensionalArray<T> extends OneDimensionalReadAccess.Base<T> implements OneDimensionalAccess<T>
MutableIndexable.Base<TT>, MutableIndexable.ListView<T>
OneDimensionalReadAccess.Base<TT>
Indexable.IndexableSpliterator<TElem>
EMPTY
EMPTY_INDEXABLE_STRING
Constructor and Description |
---|
OneDimensionalArray(java.util.Collection<T> elements)
Constructor.
|
OneDimensionalArray(Indexable<T> elements)
Constructor.
|
OneDimensionalArray(int size)
Constructor.
|
OneDimensionalArray(int size,
java.util.function.IntFunction<? extends T> filler)
Initializing Constructor.
|
OneDimensionalArray(java.lang.Iterable<T> elements)
Constructor.
|
OneDimensionalArray(T... elements)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
OneDimensionalAccess<T> |
copy()
Get an independent copy.
|
T |
get(int index)
Get the element at the given index.
|
void |
set(int index,
T elem)
Set the element at the given index.
|
int |
size()
Get the size.
|
asBase
equals, hashCode, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
changeAll, changeAll, empty, fillByIndex, setElement, setElementAt
applyOnEach, asList, copy, copyInternally, copyOf, filled, fillFrom, fromArray, fromArray, fromIndexable, fromIndexable, fromIterable, getCopy, getCopy, headSet, init, initByIndex, initFragile, listIterator, nulled, order, reverse, revert, revert, setFrom, setFrom, setFromArray, setMulti, shuffle, subSet, swap, swyp, sybSet, syt, tailSet, viewArray, viewArray, viewIndexable, viewList
change, setAll, setFrom, setFrom, setFrom
asBase, getElement, getNumDimensions, getNumElements, getSize, getSizes, singleton, view, visitAll, visitAll
addToArray, addToArray, addToCollection, asCollection, binarySearch, checkIndex, combine, compare, downCast, emptyIndexable, equal, findAll, findAllX, findFirst, findFirst, findFirst, findFirstX, findLast, findLast, findLast, findNext, findNext, findNext, findNextX, findPrevious, findPrevious, findPrevious, first, firstMatch, firstMatch, firstMatchX, forEachEntry, forEachEntryFragile, fromCollection, fromCollection, fromCountable, fromCountable, fromEnumeration, fromEnumeration, fromIterable, fromIterable, fromIterable, fromIterable, fromIterator, fromList, fromOptional, frozenSpliterator, getMod, gyt, hash, indexedView, indexes, init, initByIndex, intIndexes, isEmpty, isOrdered, isStrictlyOrdered, iterator, iterator, last, mapArray, optional, ordered, rotated, spliterator, toString, view, view, viewAsBooleanIndexable, viewAsByteIndexable, viewAsCharIndexable, viewAsDoubleIndexable, viewAsFloatIndexable, viewAsIntIndexable, viewAsLongIndexable, viewAsShortIndexable, viewByIndex, viewFragile, viewList, viewList, viewListN, viewListN, viewTuple, viewTuple, viewTuple, viewTuple, viewTuple, viewTuple, viewTuple, viewTuple, withAppendedItem, withCachedHash, withExchangedItemAt, withInsertedItemAt, withRemovedItemAt, withSwappedItemsAt
addAllTo, combined, combined, containsEq, containsRef, downCast, equal, equals, filtered, filteredToIndexable, filterToCountable, firstOrNull, foldLeft, forEachFragile, freeze, frozen, frozen, groupingBy, groupingBy, hasAll, hasAny, isSorted, isStrictlySorted, lastOrNull, mappingBy, mappingBy, optFirst, optLast, orderedCombination, sorted, toArray, toArray, toList, toString, uniform, viewCollection, viewCollection, viewCollectionN, viewCollectionN
empty, linearized
public OneDimensionalArray(@NotNull java.util.Collection<T> elements)
elements
- elements of this arraypublic OneDimensionalArray(@NotNull Indexable<T> elements)
elements
- elements of this arraypublic OneDimensionalArray(int size)
null
.size
- size of this arraypublic OneDimensionalArray(int size, @NotNull java.util.function.IntFunction<? extends T> filler)
size
- size of this arrayfiller
- filler which is called with for each element with its index
and expected to return the value at that index@SafeVarargs public OneDimensionalArray(@NotNull T... elements)
elements
- elements of this array@NotNull public OneDimensionalAccess<T> copy()
OneDimensionalAccess
copy
in interface OneDimensionalAccess<T>
copy
in interface OneDimensionalReadAccess<T>
public void set(int index, T elem)
MutableIndexable
set
in interface MutableIndexable<T>
index
- index between 0
and size() - 1
elem
- element to put to the given indexpublic int size()
Sizeable