- Type Parameters:
T
- the array element type
- All Known Implementing Classes:
Array.Store.Ref
,CharStore
,ObjectStore
public static interface Array.Store<T>
Minimal interface for accessing an underlying array structure.
- Since:
- 3.4
- Version:
- 3.4
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
Mutable reference of an underlying arrayStore
. -
Method Summary
Modifier and TypeMethodDescriptiondefault Array.Store<T>
copy()
Return a new arrayStore
copy.default Array.Store<T>
copy
(int from) Return a new arrayStore
with the copied portion of the underlying array.copy
(int from, int until) Return a new arrayStore
with the copied portion of the underlying array.get
(int index) Return the value at the given arrayindex
.int
length()
Return the length of the arrayStore
.newInstance
(int length) Return a newStore
of the same type and the given length.void
Write the givenvalue
at the givenindex
to the underlying array structure.void
sort
(int from, int until, Comparator<? super T> comparator) Sort the store.
-
Method Details
-
set
Write the givenvalue
at the givenindex
to the underlying array structure.- Parameters:
index
- the array indexvalue
- the value to set
-
get
Return the value at the given arrayindex
.- Parameters:
index
- the array index- Returns:
- the value at the given index
-
sort
Sort the store.- Parameters:
from
- the start index where to start sorting (inclusively)until
- the end index where to stop sorting (exclusively)comparator
- theComparator
used to compare sequence elements. Anull
value indicates that the elements' Comparable natural ordering should be used
-
length
int length()Return the length of the arrayStore
.- Returns:
- the array store length
-
copy
Return a new arrayStore
with the copied portion of the underlying array.- Parameters:
from
- the start index of the copied arrayuntil
- the end index of the copied array- Returns:
- a new copy of the given range
-
copy
Return a new arrayStore
with the copied portion of the underlying array.- Parameters:
from
- the start index of the copied array- Returns:
- a new copy of the given range
-
copy
Return a new arrayStore
copy.- Returns:
- a new array
Store
copy
-
newInstance
Return a newStore
of the same type and the given length.- Parameters:
length
- the length of the new store- Returns:
- a new
Store
of the same type and the given length. - Throws:
NegativeArraySizeException
- if the length is smaller than zero
-