public abstract class Shaper
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
Shaper(int[] dimSizes,
boolean[] dimVarys)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static Shaper |
createShaper(DataType dataType,
int[] dimSizes,
boolean[] dimVarys,
boolean rowMajor)
Returns an appropriate shaper instance.
|
abstract int |
getArrayIndex(int[] coords)
Returns the index into the raw value array at which the value for
the given element of the notional array can be found.
|
int[] |
getDimSizes()
Returns the dimensions of the notional array.
|
boolean[] |
getDimVarys()
Returns the dimension variances of the array.
|
abstract int |
getRawItemCount()
Returns the number of array elements in the raw value array.
|
abstract java.lang.Class<?> |
getShapeClass()
Returns the data type of the result of the
shape method. |
abstract int |
getShapedItemCount()
Returns the number of array elements in the shaped value array.
|
abstract java.lang.Object |
shape(java.lang.Object rawValue,
boolean rowMajor)
Takes a raw value array and turns it into an object of
the notional shape for this shaper.
|
protected Shaper(int[] dimSizes, boolean[] dimVarys)
dimSizes
- dimensionality of shaped arraydimVarys
- for each dimension, true for varying, false for fixedpublic abstract int getRawItemCount()
public abstract int getShapedItemCount()
public int[] getDimSizes()
public boolean[] getDimVarys()
public abstract java.lang.Class<?> getShapeClass()
shape
method.public abstract java.lang.Object shape(java.lang.Object rawValue, boolean rowMajor)
rawValue
- input raw value arraypublic abstract int getArrayIndex(int[] coords)
coords
- coordinate array, same length as dimensionalitypublic static Shaper createShaper(DataType dataType, int[] dimSizes, boolean[] dimVarys, boolean rowMajor)
dataType
- data typedimSizes
- dimensions of notional shaped arraydimVarys
- variances of shaped arrayrowMajor
- majority of raw data array;
true for row major, false for column major