T
- the type of data storedpublic class MultiDimensionalArray<T> extends Object implements MultiDimensionalCollection<T>
Constructor and Description |
---|
MultiDimensionalArray(int... sizes)
Creates an instance with the specified size along each dimension.
|
MultiDimensionalArray(MultiDimensionalCollection<T> that)
A copy constructor that constructs a shallow copy of the given collection of instances.
|
Modifier and Type | Method and Description |
---|---|
int |
dimension()
Returns the number of dimensions of the collection.
|
T |
get(int... indices)
Returns the element at the specified position in this collection.
|
T |
set(T value,
int... indices)
Replaces the element at the specified position in this list with the specified element.
|
int |
size(int i)
Returns the size of the collection along the given dimension.
|
public MultiDimensionalArray(int... sizes)
sizes
- the sizes of the dimensionspublic MultiDimensionalArray(MultiDimensionalCollection<T> that)
that
- the collection to copypublic T set(T value, int... indices)
MultiDimensionalCollection
set
in interface MultiDimensionalCollection<T>
value
- element to be stored at the specified positionindices
- the indices of the element to replacepublic T get(int... indices)
MultiDimensionalCollection
get
in interface MultiDimensionalCollection<T>
indices
- the indices of the element to returnpublic int size(int i)
MultiDimensionalCollection
size
in interface MultiDimensionalCollection<T>
i
- the index of the dimension for which to determine the sizepublic int dimension()
MultiDimensionalCollection
dimension
in interface MultiDimensionalCollection<T>
Copyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.