T
- a layout class.public abstract class Array2D<T extends Layout> extends LayoutType
Modifier and Type | Field and Description |
---|---|
protected long |
dim1 |
protected long |
dim2 |
location
Modifier | Constructor and Description |
---|---|
protected |
Array2D(long dim1,
long dim2,
long size) |
Modifier and Type | Method and Description |
---|---|
abstract T |
at(long i,
long j)
Get an array element
|
long |
dim1()
Get the length of 1st dimension
|
long |
dim2()
Get the length of 2nd dimension
|
static <T extends Layout> |
getArray2D(java.lang.Class<T> cls,
long dim1,
long dim2)
Instantiate a 2D array layout.
|
abstract void |
put(long i,
long j,
T value)
Set an array element
|
long |
sizeof()
Get the data size required for an array of a given size.
|
java.lang.String |
toString() |
bindLocation
public abstract T at(long i, long j)
i
- index in 1st dimj
- index in 2nd dimpublic final long dim1()
public final long dim2()
public static <T extends Layout> Array2D<T> getArray2D(java.lang.Class<T> cls, long dim1, long dim2)
cls
- The layout class for each array element.dim1
- The number of elements in the 1st dimension.dim2
- The number of elements in the 2nd dimensionpublic abstract void put(long i, long j, T value)
i
- index in 1st dimj
- index in 2nd dim
param value new value of the array elementpublic long sizeof()
sizeof
in class LayoutType
elementSize
- the size of the element typedim1
- length of 1st dimdim2
- length of 2nd dimpublic java.lang.String toString()
toString
in class java.lang.Object