public interface OneDimensionalReadAccess<T> extends Indexable<T>, MultiDimensionalReadAccess<T>
Modifier and Type | Interface and Description |
---|---|
static class |
OneDimensionalReadAccess.Base<TT>
Abstract base class which provides useful implementations
for
Object.equals(Object) , Object.hashCode() ,
Object.toString() . |
Indexable.IndexableSpliterator<TElem>, Indexable.ListView<T>
Modifier and Type | Field and Description |
---|---|
static OneDimensionalReadAccess<?> |
EMPTY
Empty 1dimensional read access.
|
EMPTY_INDEXABLE_STRING
Modifier and Type | Method and Description |
---|---|
default OneDimensionalReadAccess.Base<T> |
asBase()
Make this read access usable as a base class with default Object methods implemented.
|
default OneDimensionalReadAccess<T> |
copy()
Get an independent copy.
|
static <E> OneDimensionalReadAccess<E> |
empty()
Get an empty 1dimensional read access.
|
default T |
getElement(int... indexes)
Get the element located at the given indexes.
|
default int |
getNumDimensions()
Get the number of dimensions used by this access,
|
default long |
getNumElements()
Get the combined number of elements in all dimensions.
|
default int |
getSize(int dim)
Get the size of the given dimension.
|
default int[] |
getSizes()
Get the sizes of the dimensions of this access.
|
static <E> OneDimensionalReadAccess<E> |
singleton(E singleElement)
Get a 1dimensional read access for a single element
|
default <TOUT> OneDimensionalReadAccess<TOUT> |
view(Function1<TOUT,? super T> conv)
Get a view of this 1-dimensional access with converted elements.
|
default void |
visitAll(Procedure1<? super T> visitor)
Visit all elements in this multi-dimensional array.
|
default void |
visitAll(Procedure2<? super T,int[]> visitor)
Visit all elements of this multi-dimensional array.
|
addToArray, addToArray, addToCollection, asCollection, asList, binarySearch, combine, compare, downCast, emptyIndexable, equal, findAll, findFirst, findFirst, findFirst, findLast, findLast, findLast, findNext, findNext, findNext, findPrevious, findPrevious, findPrevious, first, firstMatch, firstMatch, forEachEntry, forEachEntryFragile, fromArray, fromCollection, fromCollection, fromCountable, fromCountable, fromEnumeration, fromEnumeration, fromIterable, fromIterable, fromIterable, fromIterable, fromIterator, fromList, fromOptional, frozenSpliterator, get, gyt, hash, headSet, indexedView, indexes, init, initByIndex, intIndexes, isEmpty, isOrdered, isStrictlyOrdered, iterator, iterator, last, listIterator, mapArray, optional, ordered, reverse, rotated, spliterator, subSet, sybSet, tailSet, toList, toString, view, view, viewArray, viewArray, viewAsBooleanIndexable, viewAsByteIndexable, viewAsCharIndexable, viewAsDoubleIndexable, viewAsFloatIndexable, viewAsIntIndexable, viewAsLongIndexable, viewAsShortIndexable, viewByIndex, 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, foldLeft, forEachFragile, frozen, frozen, groupingBy, groupingBy, hasAll, hasAny, isSorted, isStrictlySorted, mappingBy, mappingBy, orderedCombination, sorted, toArray, toArray, toString, uniform, viewCollection, viewCollection, viewCollectionN, viewCollectionN
empty, linearized
static final OneDimensionalReadAccess<?> EMPTY
empty()
instead.default T getElement(int... indexes)
MultiDimensionalReadAccess
getElement
in interface MultiDimensionalReadAccess<T>
indexes
- MultiDimensional.getNumDimensions()
indexes inside the bounds
defined by MultiDimensional.getSizes()
default int getNumDimensions()
MultiDimensional
getNumDimensions
in interface MultiDimensional
default int getSize(int dim)
MultiDimensional
getSize
in interface MultiDimensional
dim
- dimension, greater than 0
and less than MultiDimensional.getNumDimensions()
@NotNull default int[] getSizes()
MultiDimensional
getSizes
in interface MultiDimensional
MultiDimensional.getNumDimensions()
default long getNumElements()
MultiDimensional
getNumElements
in interface MultiDimensional
@NotNull default OneDimensionalReadAccess<T> copy()
@NotNull default <TOUT> OneDimensionalReadAccess<TOUT> view(@NotNull Function1<TOUT,? super T> conv)
TOUT
- element type of the returned viewconv
- converted applied to the elementsdefault void visitAll(@NotNull Procedure2<? super T,int[]> visitor)
MultiDimensionalReadAccess
visitAll
in interface MultiDimensionalReadAccess<T>
visitor
- visitor called with an array element and its multi-indexdefault void visitAll(@NotNull Procedure1<? super T> visitor)
MultiDimensionalReadAccess
visitAll
in interface MultiDimensionalReadAccess<T>
visitor
- element visitor called once with each element@NotNull default OneDimensionalReadAccess.Base<T> asBase()
@NotNull static <E> OneDimensionalReadAccess<E> empty()
@NotNull static <E> OneDimensionalReadAccess<E> singleton(E singleElement)