public abstract class DataCollection extends java.lang.Object implements Indexable
Modifier and Type | Field and Description |
---|---|
static int |
attributeOrder |
protected AxisOrdering |
axisOrdering
AxisOrdering describes how axis indexes map to the physical data storage
|
protected long[] |
axisWeights
axisWeights define stride values to find the neighbor in index space in a
given axis.
|
protected ISBounds |
bounds
Denotes extent of Index Space
|
protected int |
dataOrder
Defines the preferred data order -- either by attribute or by point.
|
protected int |
dimensionality
This value is taken from this.bounds, but is duplicated here for speed.
|
protected int |
numAttributes
This value is taken from this.recordDesc, but is duplicated here for speed.
|
static int |
pointOrder |
protected RecordDescriptor |
recordDesc
Describes fields of Datums returned by this DataSource.
|
Modifier | Constructor and Description |
---|---|
protected |
DataCollection()
For now, prevent construction without knowledge of bounds, exc by children
|
protected |
DataCollection(ISBounds inBounds,
RecordDescriptor rd)
Create a DataCollection with given bounds and record descriptor.
|
protected |
DataCollection(ISBounds inBounds,
RecordDescriptor rd,
AxisOrdering ordering)
Create a DataCollection with given bounds, record descriptor, and axisordering
|
Modifier and Type | Method and Description |
---|---|
int |
byteSize()
Return the number of bytes used to represent a datum.
|
protected int |
computeOffset(IndexSpaceID dsid)
Maps an n-dimensional IndexSpaceID to a 1d offset.
|
protected int |
computeOffset(int[] coordArray)
Maps an n-dimensional array of coordinates to a 1d offset
|
ISBounds |
copyBounds()
Returns a copy of the bounds of the Index Space for this DataSource.
|
DataBlock |
createDataBlock(ISBounds bnds)
create a DataBlock matching RecordDescriptor.
|
DataBlock |
createDataBlock(ISBounds bnds,
FieldIDMapper fm)
create a DataBlock matching RecordDescr adjusted by FieldIDMapper.
|
DataBlock |
createDataBlock(ISBounds bnds,
RecordSpec rs)
create a DataBlock matching RecordDescriptor, adjusted by RecordSpec.
|
Datum |
createDatum()
create a Datum matching RecordDescriptor.
|
Datum |
createDatum(Datum d)
create a Datum matching RecordDescriptor, initialized to Datum value.
|
Datum |
createDatum(Datum d,
FieldIDMapper fm)
create a Datum matching RecordDescriptor, based on FieldIDMapper, init to Datum.
|
Datum |
createDatum(Datum d,
RecordSpec rs)
create a Datum matching RecordDescriptor, based or RecordSpec, init to Datum.
|
Datum |
createDatum(FieldIDMapper fm)
create a Datum matching RecordDescriptor, adjusted by FieldIDMapper.
|
Datum |
createDatum(RecordSpec rs)
create a Datum matching RecordDescriptor, adjusted by RecordSpec.
|
void |
datum(Datum dtm,
IndexSpaceID did)
Given an IndexSpaceID, copy the values of the Datum at that position to the
argument Datum.
|
abstract void |
datum(Datum dtm,
IndexSpaceID did,
FieldIDMapper mp)
Given an IndexSpaceID and FieldIDMapper, copy the values of the Datum at
that position to the argument Datum.
|
void |
datum(Datum dtm,
IndexSpaceID did,
RecordSpec recSpec)
Given an IndexSpaceID and RecordSpec, copy the values of the Datum at
that position to the argument Datum.
|
void |
datum(Datum d,
int[] coordArray)
Copy the Datum argument into the position indicated by the values in
the int coordArray interpreted as an IndexSpaceID.
|
Datum |
datum(IndexSpaceID did)
Given an IndexSpaceID, return the corresponding datum.
|
Datum |
datum(IndexSpaceID did,
FieldIDMapper fmap)
Given an IndexSpaceID, return the corresponding datum with attributes
specified in the FieldIDMapper.
|
Datum |
datum(IndexSpaceID did,
RecordSpec spec)
Given an IndexSpaceID, return the corresponding datum with attributes
specified in the RecordSpec.
|
int |
dim()
Returns the dimensionality of the Index Space for this DataSource.
|
java.lang.String[] |
getAttributeNames()
return the name of each attribute
|
AxisOrdering |
getAxisOrdering()
Return a copy of the AxisOrdering .
|
long |
getAxisWeight(int axis)
Return the Weight of the specified axis.
|
long[] |
getAxisWeights()
Return the Weight of the specified axis.
|
ISBounds |
getBounds()
Return a reference to the ISBounds for this DataBlock.
|
byte |
getByte(IndexSpaceID isid,
int attr)
Return the field specified by the arguments as a byte.
|
byte[] |
getBytes()
Return a 1-d byte array containing all values of all
attributes using the existing axis axisOrdering and data axisOrdering
(attribute vs.
|
byte[] |
getBytes(byte[] filler)
Fill a 1-d array containing all values of all attributes using the
existing axis axisOrdering and data axisOrdering (attribute vs.
|
byte[] |
getBytes(IndexSpaceID isid)
Return all attributes of the Datum as a single byte array
|
byte[] |
getBytes(IndexSpaceID isid,
byte[] fill)
Reference version of getBytes( isid )
The passed array is returned for convenience, but if it is
null or not the right length a new array is created and returned.
|
byte[] |
getBytes(int attr)
Return a 1-d byte array containing all values of the specified
attribute using the existing axis axisOrdering.
|
byte[] |
getBytes(int attr,
byte[] fill)
Fill the passed 1-d byte array with all values of the specified
attribute using the existing axis axisOrdering.
|
byte[] |
getBytesByAttribute()
Return a 1-d byte array containing all values of all
attributes in attribute order using the existing axis axisOrdering.
|
byte[] |
getBytesByAttribute(byte[] filler)
Fill a 1-d array containing all values of all attributes using the
existing axis axisOrdering and data axisOrdering (attribute vs.
|
byte[] |
getBytesByPoint()
Return a 1-d byte array containing all values of all
attributes in point order using the existing axis axisOrdering.
|
byte[] |
getBytesByPoint(byte[] filler)
Fill a 1-d array containing all values of all attributes using the
existing axis axisOrdering and attribute data axisOrdering.
|
int |
getDataOrder()
Returns the data storage order.
|
int[] |
getDimensionsArray()
Return a reference to an array containing
the dimensions of this data collection.
|
double |
getDouble(IndexSpaceID isid,
int attr)
Return the field specified by the arguments as a double.
|
double[] |
getDoubles()
Return a 1-d double array containing all values of all
attributes using the existing axis axisOrdering and data axisOrdering
(attribute vs.
|
double[] |
getDoubles(double[] filler)
Fill a 1-d array containing all values of all attributes using the
existing axis axisOrdering and data axisOrdering (attribute vs.
|
double[] |
getDoubles(IndexSpaceID isid)
Return all attributes of the Datum at the as a 1-d double array
|
double[] |
getDoubles(IndexSpaceID isid,
double[] fill)
Reference version of getDoubles( isid )
The passed array is returned for convenience, but if it is
null or not the right length a new array is created and returned.
|
double[] |
getDoubles(int attr)
Return a 1-d double array containing all values of the specified
attribute using the existing axis axisOrdering.
|
double[] |
getDoubles(int attr,
double[] fill)
Fill the passed 1-d double array with all values of the specified
attribute using the existing axis axisOrdering.
|
double[] |
getDoublesByAttribute()
Return a 1-d double array containing all values of all
attributes in attribute order using the existing axis axisOrdering.
|
double[] |
getDoublesByAttribute(double[] filler)
Fill a 1-d array containing all values of all attributes using the
existing axis axisOrdering and data axisOrdering (attribute vs.
|
double[] |
getDoublesByPoint()
Return a 1-d double array containing all values of all
attributes in point order using the existing axis axisOrdering.
|
double[] |
getDoublesByPoint(double[] filler)
Fill a 1-d array containing all values of all attributes using the
existing axis axisOrdering and attribute data axisOrdering.
|
float |
getFloat(IndexSpaceID isid,
int attr)
Return the field specified by the arguments as a float.
|
float[] |
getFloats()
Return a 1-d float array containing all values of all
attributes using the existing axis axisOrdering and data axisOrdering
(attribute vs.
|
float[] |
getFloats(float[] filler)
Fill a 1-d array containing all values of all attributes using the
existing axis axisOrdering and data axisOrdering (attribute vs.
|
float[] |
getFloats(IndexSpaceID isid)
Return all attributes of the Datum as a 1-d float array
|
float[] |
getFloats(IndexSpaceID isid,
float[] fill)
Reference version of getFloats( isid )
The passed array is returned for convenience, but if it is
null or not the right length a new array is created and returned.
|
float[] |
getFloats(int attr)
Return a 1-d float array containing all values of the specified
attribute using the existing axis axisOrdering.
|
float[] |
getFloats(int attr,
float[] fill)
Fill the passed 1-d float array with all values of the specified
attribute using the existing axis axisOrdering.
|
float[] |
getFloatsByAttribute()
Return a 1-d float array containing all values of all
attributes in attribute order using the existing axis axisOrdering.
|
float[] |
getFloatsByAttribute(float[] filler)
Fill a 1-d array containing all values of all attributes using the
existing axis axisOrdering and data axisOrdering (attribute vs.
|
float[] |
getFloatsByPoint()
Return a 1-d float array containing all values of all
attributes in point order using the existing axis axisOrdering.
|
float[] |
getFloatsByPoint(float[] filler)
Fill a 1-d array containing all values of all attributes using the
existing axis axisOrdering and attribute data axisOrdering.
|
int |
getInt(IndexSpaceID isid,
int attr)
Return the field specified by the arguments as an int.
|
int[] |
getInts()
Return a 1-d int array containing all values of all
attributes using the existing axis axisOrdering and data axisOrdering
(attribute vs.
|
int[] |
getInts(IndexSpaceID isid)
Return all attributes of the Datum as a 1-d int array
|
int[] |
getInts(IndexSpaceID isid,
int[] fill)
Reference version of getInts( isid )
The passed array is returned for convenience, but if it is
null or not the right length a new array is created and returned.
|
int[] |
getInts(int attr)
Return a 1-d int array containing all values of the specified
attribute using the existing axis axisOrdering.
|
int[] |
getInts(int[] filler)
Fill a 1-d array containing all values of all attributes using the
existing axis axisOrdering and data axisOrdering (attribute vs.
|
int[] |
getInts(int attr,
int[] fill)
Fill the passed 1-d int array with all values of the specified
attribute using the existing axis axisOrdering.
|
int[] |
getIntsByAttribute()
Return a 1-d int array containing all values of all
attributes in attribute order using the existing axis axisOrdering.
|
int[] |
getIntsByAttribute(int[] filler)
Fill a 1-d array containing all values of all attributes using the
existing axis axisOrdering and data axisOrdering (attribute vs.
|
int[] |
getIntsByPoint()
Return a 1-d int array containing all values of all
attributes in point order using the existing axis axisOrdering.
|
int[] |
getIntsByPoint(int[] filler)
Fill a 1-d array containing all values of all attributes using the
existing axis axisOrdering and attribute data axisOrdering.
|
int[] |
getLowerBoundsArray()
Return a reference to an array containing
the lower bounds of this collection.
|
int |
getNumAttributes()
return the number of attributes at each position of the index space.
|
RecordDescriptor |
getRecordDescriptor()
Returns a copy of the RecordDescriptor
|
short |
getShort(IndexSpaceID isid,
int attr)
Return the field specified by the arguments as a short.
|
short[] |
getShorts()
Return a 1-d short array containing all values of all
attributes using the existing axis axisOrdering and data axisOrdering
(attribute vs.
|
short[] |
getShorts(IndexSpaceID isid)
Return all attributes of the Datum as a 1-d short array
|
short[] |
getShorts(IndexSpaceID isid,
short[] fill)
Reference version of getShorts( isid )
The passed array is returned for convenience, but if it is
null or not the right length a new array is created and returned.
|
short[] |
getShorts(int attr)
Return a 1-d short array containing all values of the specified
attribute using the existing axis axisOrdering.
|
short[] |
getShorts(int attr,
short[] fill)
Fill the passed 1-d short array with all values of the specified
attribute using the existing axis axisOrdering.
|
short[] |
getShorts(short[] filler)
Fill a 1-d array containing all values of all attributes using the
existing axis axisOrdering and data axisOrdering (attribute vs.
|
short[] |
getShortsByAttribute()
Return a 1-d short array containing all values of all
attributes in attribute order using the existing axis axisOrdering.
|
short[] |
getShortsByAttribute(short[] filler)
Fill a 1-d array containing all values of all attributes using the
existing axis axisOrdering and data axisOrdering (attribute vs.
|
short[] |
getShortsByPoint()
Return a 1-d short array containing all values of all
attributes in point order using the existing axis axisOrdering.
|
short[] |
getShortsByPoint(short[] filler)
Fill a 1-d array containing all values of all attributes using the
existing axis axisOrdering and attribute data axisOrdering.
|
int |
getStorageType()
return the storage type for this collection
|
int[] |
getUpperBoundsArray()
Return a reference to an array containing
the upper bounds of this collection.
|
abstract Values |
getValues()
Return a Values array of all attributes in whatever type and order
they are stored internally (either attribute order or point order
for Granite-defined objects).
|
Values |
getValues(int attr)
Return a Values array of the specified attribute in whatever type
it has internally.
|
Values |
getValuesByAttribute()
Return a Values array of all attributes in their internal type in
the attribute order.
|
Values |
getValuesByPoint()
Return a Values array of all attributes in their internal type in
the point order.
|
long |
longVolume()
Returns a long with the number of elements in this datasource index space.
|
void |
setAxisOrdering(AxisOrdering newOrder)
Set a new the AxisOrdering for this datasource.
|
protected void |
setBounds(ISBounds bounds)
Sets the bounds of the Index Space for this DataSource.
|
protected void |
setRecordDescriptor(RecordDescriptor r)
Set the DataSource RecordDescriptor to a copy
of the argument.
|
int |
size()
Deprecated.
Use volume() method.
|
void |
subblock(DataBlock theBlock,
ISBounds srcBounds)
Reads a subblock defined by srcBounds into the Datablock argument.
|
void |
subblock(DataBlock theBlock,
ISBounds srcBounds,
FieldIDMapper fmap)
Reads a subblock defined by srcBounds into the Datablock argument.
|
abstract void |
subblock(DataBlock theBlock,
ISBounds dstBounds,
ISBounds srcBounds)
Reads a subblock defined by srcBounds into the region of the Datablock argument
defined by dstBounds.
|
abstract void |
subblock(DataBlock theBlock,
ISBounds dstBounds,
ISBounds srcBounds,
FieldIDMapper mp)
Reads a subblock defined by srcBounds into the region of the Datablock argument
defined by dstBounds.
|
void |
subblock(DataBlock theBlock,
ISBounds dstBounds,
ISBounds srcBounds,
RecordSpec spec)
Reads a subblock defined by srcBounds into the region of the Datablock argument
defined by dstBounds.
|
void |
subblock(DataBlock theBlock,
ISBounds srcBounds,
RecordSpec rs)
Reads a subblock defined by srcBounds into the Datablock argument.
|
void |
subblock(DSBlockStencil stencil)
Fill the datablocks specified as "active" in the DSBlockStencil.
|
DataBlock |
subblock(FieldIDMapper fmap)
Return a new DataBlock that is an attribute projection of this DataCollection
based on the attributes as defined by the FieldIDMapper.
|
DataBlock |
subblock(ISBounds srcBounds)
Return a new DataBlock that is a subset of this DataCollection.
|
DataBlock |
subblock(ISBounds srcBounds,
FieldIDMapper fmap)
Return a new DataBlock that is a subset of this datablock based on bounds
and selective attributes as defined by the FieldIDMapper.
|
DataBlock |
subblock(ISBounds srcBounds,
RecordSpec rs)
Return a new DataBlock that is a subset of this DataCollection based
on bounds and selective attributes as defined by the RecordSpec.
|
DataBlock |
subblock(RecordSpec rs)
Return a new DataBlock that is an attribute projection of this DataCollection
based on the attributes as defined by the RecordSpec.
|
void |
useBytesOnly()
When this method is called, this subblock methods of this collection will
read data as bytes, without performing any type conversion.
|
int |
volume()
Returns the number of elements in this datasource index space.
|
protected ISBounds bounds
protected RecordDescriptor recordDesc
protected int dimensionality
protected int numAttributes
protected int dataOrder
public static final int pointOrder
public static final int attributeOrder
protected AxisOrdering axisOrdering
protected long[] axisWeights
protected DataCollection()
protected DataCollection(ISBounds inBounds, RecordDescriptor rd)
protected DataCollection(ISBounds inBounds, RecordDescriptor rd, AxisOrdering ordering)
public Datum datum(IndexSpaceID did)
public Datum datum(IndexSpaceID did, RecordSpec spec)
public Datum datum(IndexSpaceID did, FieldIDMapper fmap)
public void datum(Datum dtm, IndexSpaceID did)
public abstract void datum(Datum dtm, IndexSpaceID did, FieldIDMapper mp)
public void datum(Datum dtm, IndexSpaceID did, RecordSpec recSpec)
public void datum(Datum d, int[] coordArray)
public DataBlock subblock(ISBounds srcBounds)
public DataBlock subblock(RecordSpec rs)
public DataBlock subblock(FieldIDMapper fmap)
public DataBlock subblock(ISBounds srcBounds, RecordSpec rs)
public DataBlock subblock(ISBounds srcBounds, FieldIDMapper fmap)
public abstract void subblock(DataBlock theBlock, ISBounds dstBounds, ISBounds srcBounds)
public abstract void subblock(DataBlock theBlock, ISBounds dstBounds, ISBounds srcBounds, FieldIDMapper mp)
public void subblock(DataBlock theBlock, ISBounds srcBounds)
public void subblock(DataBlock theBlock, ISBounds srcBounds, RecordSpec rs)
public void subblock(DataBlock theBlock, ISBounds srcBounds, FieldIDMapper fmap)
public void subblock(DataBlock theBlock, ISBounds dstBounds, ISBounds srcBounds, RecordSpec spec)
public void subblock(DSBlockStencil stencil)
public final int dim()
public final ISBounds copyBounds()
copyBounds
in interface Indexable
public final ISBounds getBounds()
public final int[] getDimensionsArray()
public final int[] getLowerBoundsArray()
public final int[] getUpperBoundsArray()
public final int getDataOrder()
protected final int computeOffset(IndexSpaceID dsid)
protected final int computeOffset(int[] coordArray)
public int size()
public int volume()
public final long longVolume()
protected final void setBounds(ISBounds bounds)
public final int getNumAttributes()
getNumAttributes
in interface Indexable
public final java.lang.String[] getAttributeNames()
public final int getStorageType()
public final RecordDescriptor getRecordDescriptor()
getRecordDescriptor
in interface Indexable
public final int byteSize()
public void useBytesOnly()
protected final void setRecordDescriptor(RecordDescriptor r)
public AxisOrdering getAxisOrdering()
public void setAxisOrdering(AxisOrdering newOrder)
public final long getAxisWeight(int axis)
public final long[] getAxisWeights()
public final Datum createDatum()
public final Datum createDatum(RecordSpec rs)
public final Datum createDatum(FieldIDMapper fm)
public final Datum createDatum(Datum d)
public final Datum createDatum(Datum d, RecordSpec rs)
public final Datum createDatum(Datum d, FieldIDMapper fm)
public final DataBlock createDataBlock(ISBounds bnds)
public final DataBlock createDataBlock(ISBounds bnds, RecordSpec rs)
public final DataBlock createDataBlock(ISBounds bnds, FieldIDMapper fm)
public double getDouble(IndexSpaceID isid, int attr)
public float getFloat(IndexSpaceID isid, int attr)
public int getInt(IndexSpaceID isid, int attr)
public short getShort(IndexSpaceID isid, int attr)
public byte getByte(IndexSpaceID isid, int attr)
public double[] getDoubles(IndexSpaceID isid)
public double[] getDoubles(IndexSpaceID isid, double[] fill)
public float[] getFloats(IndexSpaceID isid)
public float[] getFloats(IndexSpaceID isid, float[] fill)
public int[] getInts(IndexSpaceID isid)
public int[] getInts(IndexSpaceID isid, int[] fill)
public short[] getShorts(IndexSpaceID isid)
public short[] getShorts(IndexSpaceID isid, short[] fill)
public byte[] getBytes(IndexSpaceID isid)
public byte[] getBytes(IndexSpaceID isid, byte[] fill)
public double[] getDoubles(int attr)
public double[] getDoubles(int attr, double[] fill)
public float[] getFloats(int attr)
public float[] getFloats(int attr, float[] fill)
public int[] getInts(int attr)
public int[] getInts(int attr, int[] fill)
public short[] getShorts(int attr)
public short[] getShorts(int attr, short[] fill)
public byte[] getBytes(int attr)
public byte[] getBytes(int attr, byte[] fill)
public double[] getDoubles()
public double[] getDoubles(double[] filler)
public double[] getDoublesByAttribute()
public double[] getDoublesByAttribute(double[] filler)
public double[] getDoublesByPoint()
public double[] getDoublesByPoint(double[] filler)
public float[] getFloats()
public float[] getFloats(float[] filler)
public float[] getFloatsByAttribute()
public float[] getFloatsByPoint()
public float[] getFloatsByAttribute(float[] filler)
public float[] getFloatsByPoint(float[] filler)
public int[] getInts()
public int[] getInts(int[] filler)
public int[] getIntsByAttribute()
public int[] getIntsByPoint()
public int[] getIntsByAttribute(int[] filler)
public int[] getIntsByPoint(int[] filler)
public short[] getShorts()
public short[] getShorts(short[] filler)
public short[] getShortsByAttribute()
public short[] getShortsByPoint()
public short[] getShortsByAttribute(short[] filler)
public short[] getShortsByPoint(short[] filler)
public byte[] getBytes()
public byte[] getBytes(byte[] filler)
public byte[] getBytesByAttribute()
public byte[] getBytesByPoint()
public byte[] getBytesByAttribute(byte[] filler)
public byte[] getBytesByPoint(byte[] filler)
public abstract Values getValues()
public Values getValuesByAttribute()
public Values getValuesByPoint()
public Values getValues(int attr)