T
- a layout class.public abstract class Array1D<T extends Layout> extends LayoutType
Modifier and Type | Field and Description |
---|---|
protected long |
elementSize |
protected long |
length |
location
Modifier | Constructor and Description |
---|---|
protected |
Array1D(long length,
long size) |
Modifier and Type | Method and Description |
---|---|
abstract T |
at(long index)
Get an array element
|
static <T extends Layout> |
getArray1D(java.lang.Class<T> cls,
long length)
Instantiate a 1D array layout.
|
long |
getLength()
Get the number of array elements.
|
static <E extends Layout,AE extends Array1D<E>> |
getUserArray1D(java.lang.Class<AE> userArrayCls,
java.lang.Class<E> elementLayout,
long length)
Instantiate a user extension of a 1D array layout.
|
abstract void |
put(long index,
T value)
Set an array element
|
abstract Array1D<T> |
range(long startIdx,
long length)
Extract a sub range of the array
|
long |
sizeof()
Get the data size required for an array of a given length.
|
java.lang.String |
toString() |
bindLocation
public abstract T at(long index)
index
- the element indexpublic static <T extends Layout> Array1D<T> getArray1D(java.lang.Class<T> cls, long length)
cls
- The layout class for each array element.length
- The number of array elements.public final long getLength()
public static <E extends Layout,AE extends Array1D<E>> AE getUserArray1D(java.lang.Class<AE> userArrayCls, java.lang.Class<E> elementLayout, long length)
userArrayCls
- A user-extension of an Array1D interface.elementLayout
- The element type of the array.length
- The number of array elements.public abstract void put(long index, T value)
index
- index in 2nd dim
param value new value of the array elementpublic abstract Array1D<T> range(long startIdx, long length)
startIdx
- the starting array indexlength
- the number of array elements to extractpublic long sizeof()
sizeof
in class LayoutType
elementSize
- the size of the element typelength
- The number of elements.public java.lang.String toString()
toString
in class java.lang.Object