edu.unh.sdb.datasource
Class DataCollection

java.lang.Object
  extended by edu.unh.sdb.datasource.DataCollection
All Implemented Interfaces:
Indexable
Direct Known Subclasses:
CellDataCollection, DataBlock, DataSource, VRIndexable

public abstract class DataCollection
extends java.lang.Object
implements Indexable


Field Summary
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.
 
Constructor Summary
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
 
Method Summary
 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.
 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
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bounds

protected ISBounds bounds
Denotes extent of Index Space


recordDesc

protected RecordDescriptor recordDesc
Describes fields of Datums returned by this DataSource.


dimensionality

protected int dimensionality
This value is taken from this.bounds, but is duplicated here for speed.


numAttributes

protected int numAttributes
This value is taken from this.recordDesc, but is duplicated here for speed.


dataOrder

protected int dataOrder
Defines the preferred data order -- either by attribute or by point. In normal cases, this reflects the actual storage axisOrdering, but for some complex formats, it's what is likely to provide most efficient mass data access. This is especially an issue for the methods: getDoubles(), getFloats(), getInts(), getShorts(), getBytes()


pointOrder

public static final int pointOrder
See Also:
Constant Field Values

attributeOrder

public static final int attributeOrder
See Also:
Constant Field Values

axisOrdering

protected AxisOrdering axisOrdering
AxisOrdering describes how axis indexes map to the physical data storage


axisWeights

protected long[] axisWeights
axisWeights define stride values to find the neighbor in index space in a given axis.

Constructor Detail

DataCollection

protected DataCollection()
For now, prevent construction without knowledge of bounds, exc by children


DataCollection

protected DataCollection(ISBounds inBounds,
                         RecordDescriptor rd)
Create a DataCollection with given bounds and record descriptor.


DataCollection

protected DataCollection(ISBounds inBounds,
                         RecordDescriptor rd,
                         AxisOrdering ordering)
Create a DataCollection with given bounds, record descriptor, and axisordering

Method Detail

datum

public Datum datum(IndexSpaceID did)
Given an IndexSpaceID, return the corresponding datum.

Specified by:
datum in interface Indexable

datum

public Datum datum(IndexSpaceID did,
                   RecordSpec spec)
Given an IndexSpaceID, return the corresponding datum with attributes specified in the RecordSpec.

Specified by:
datum in interface Indexable

datum

public Datum datum(IndexSpaceID did,
                   FieldIDMapper fmap)
Given an IndexSpaceID, return the corresponding datum with attributes specified in the FieldIDMapper.


datum

public void datum(Datum dtm,
                  IndexSpaceID did)
Given an IndexSpaceID, copy the values of the Datum at that position to the argument Datum. TODO Define error conditions

Specified by:
datum in interface Indexable

datum

public 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. TODO Define error conditions

Specified by:
datum in interface Indexable

datum

public 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. TODO Define error conditions Definition below as in DataSource. rdb: I thought RecordSpec "selected" fields from source, not from the destination. PBR: Return by reference the Datum corresponding to the given IndexSpaceID. Only datum fields referred to by the RecordSpec are modified.

Specified by:
datum in interface Indexable

datum

public 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. Some children may find it convenient to override this to avoid the construction of the IndexSpaceID.


subblock

public DataBlock subblock(ISBounds srcBounds)
Return a new DataBlock that is a subset of this DataCollection. The data may be shared.

Specified by:
subblock in interface Indexable

subblock

public 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. It is legal to pass a null for the RecordSpec argument which means that all attributes are to be extracted.


subblock

public 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. It is legal to pass a null for the FieldIDMapper argument which means that all attributes are to be extracted.


subblock

public 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. It is legal to pass a null for the RecordSpec argument which means that all attributes are to be extracted.

Specified by:
subblock in interface Indexable

subblock

public 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. It is legal to pass a null for the FieldIDMapper argument which means that all attributes are to be extracted.

Specified by:
subblock in interface Indexable

subblock

public 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.

Specified by:
subblock in interface Indexable

subblock

public 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. The FieldIDMapper argument determines the mapping between datums in this DataBlock and datums in the argument DataBlock. It is legal to pass a null for the FieldIDMapper argument which means that all attributes are to be extracted.

Specified by:
subblock in interface Indexable

subblock

public void subblock(DataBlock theBlock,
                     ISBounds srcBounds)
Reads a subblock defined by srcBounds into the Datablock argument. If the size and shape of the DataBlock argument does not match the source bounds, the source bounds will be modified to match the destination shape and size, if there is enough data in the source; otherwise, only the portion of the destination is changed for which there is source data.


subblock

public void subblock(DataBlock theBlock,
                     ISBounds srcBounds,
                     RecordSpec rs)
Reads a subblock defined by srcBounds into the Datablock argument. If the size and shape of the DataBlock argument does not match the source bounds, the source bounds will be modified to match the destination shape and size, if there is enough data in the source; otherwise, only the portion of the destination is changed for which there is source data. Only the attributes identified by the RecordSpec are included. It is valid for the RecordSpec argument to be null; this specifies that all attributes are to be extracted.


subblock

public void subblock(DataBlock theBlock,
                     ISBounds srcBounds,
                     FieldIDMapper fmap)
Reads a subblock defined by srcBounds into the Datablock argument. If the size and shape of the DataBlock argument does not match the source bounds, the source bounds will be modified to match the destination shape and size, if there is enough data in the source; otherwise, only the portion of the destination is changed for which there is source data. Only the attributes identified by the FieldIDMapper are included. It is valid for the FieldIDMapper argument to be null; this specifies that all attributes are to be extracted.


subblock

public 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. The RecordSpec argument specifies a subset of the attributes of this DataSource to be written into the DataBlock datums. It is legal to pass a null for the RecordSpec argument which means that all attributes are to be extracted.

Specified by:
subblock in interface Indexable

subblock

public void subblock(DSBlockStencil stencil)
Fill the datablocks specified as "active" in the DSBlockStencil. This method is meant to save latency costs across a network by filling several datablocks with a single query.


dim

public final int dim()
Returns the dimensionality of the Index Space for this DataSource.

Specified by:
dim in interface Indexable

copyBounds

public final ISBounds copyBounds()
Returns a copy of the bounds of the Index Space for this DataSource. Can make deprecated to find out who is using to make sure they shouldn't be using getBounds() (the reference version).

Specified by:
copyBounds in interface Indexable

getBounds

public final ISBounds getBounds()
Return a reference to the ISBounds for this DataBlock.

Specified by:
getBounds in interface Indexable

getDimensionsArray

public final int[] getDimensionsArray()
Return a reference to an array containing the dimensions of this data collection.


getLowerBoundsArray

public final int[] getLowerBoundsArray()
Return a reference to an array containing the lower bounds of this collection.


getDataOrder

public final int getDataOrder()
Returns the data storage order. Normally data will be stored either in attribute order (all values of same attribute are contiguous) or in point order (all values of a single point are contiguous). In a physical file, arbitrary combinations are possible although we currently only support attribute order or point order. Even if we later support other file orderings, we might want to retain the "view" of everything internally to be one of these two. The value returned will be one of: DataCollection.pointOrder DataCollection.attributeOrder


computeOffset

protected final int computeOffset(IndexSpaceID dsid)
Maps an n-dimensional IndexSpaceID to a 1d offset.


computeOffset

protected final int computeOffset(int[] coordArray)
Maps an n-dimensional array of coordinates to a 1d offset


size

public int size()
Deprecated. Use volume() method.

Return the number of datums .


volume

public int volume()
Returns the number of elements in this datasource index space.


longVolume

public final long longVolume()
Returns a long with the number of elements in this datasource index space.


setBounds

protected final void setBounds(ISBounds bounds)
Sets the bounds of the Index Space for this DataSource. This method is meant to be called by the constructors of certain child classes, e.g. BlockedDataSource. If a null reference is passed, then an IllegalArgumentException is thrown.


getNumAttributes

public final int getNumAttributes()
return the number of attributes at each position of the index space.

Specified by:
getNumAttributes in interface Indexable

getStorageType

public final int getStorageType()
return the storage type for this collection


getRecordDescriptor

public final RecordDescriptor getRecordDescriptor()
Returns a copy of the RecordDescriptor

Specified by:
getRecordDescriptor in interface Indexable

byteSize

public final int byteSize()
Return the number of bytes used to represent a datum.


useBytesOnly

public void useBytesOnly()
When this method is called, this subblock methods of this collection will read data as bytes, without performing any type conversion. This is meant to be used by servers, since they send raw bytes over the network anyway, and any conversion is wasted effort.


setRecordDescriptor

protected final void setRecordDescriptor(RecordDescriptor r)
Set the DataSource RecordDescriptor to a copy of the argument. This method is meant to be called by the constructors of child classes, e.g. AttributeJoinDataSource. If a null reference is passed, then an IllegalArgumentException is thrown.


getAxisOrdering

public AxisOrdering getAxisOrdering()
Return a copy of the AxisOrdering .


setAxisOrdering

public final void setAxisOrdering(AxisOrdering newOrder)
Set a new the AxisOrdering for this datasource. Note that this operation will have no affect on previously constructed Iterators or DataBlocks constructed for this DataSource. Note that children may need to override if there is something more than the axisWeights that needs to be recomputed.


getAxisWeight

public final long getAxisWeight(int axis)
Return the Weight of the specified axis.


getAxisWeights

public final long[] getAxisWeights()
Return the Weight of the specified axis.


createDatum

public final Datum createDatum()
create a Datum matching RecordDescriptor.


createDatum

public final Datum createDatum(RecordSpec rs)
create a Datum matching RecordDescriptor, adjusted by RecordSpec.


createDatum

public final Datum createDatum(FieldIDMapper fm)
create a Datum matching RecordDescriptor, adjusted by FieldIDMapper.


createDatum

public final Datum createDatum(Datum d)
create a Datum matching RecordDescriptor, initialized to Datum value.


createDatum

public final Datum createDatum(Datum d,
                               RecordSpec rs)
create a Datum matching RecordDescriptor, based or RecordSpec, init to Datum.


createDatum

public final Datum createDatum(Datum d,
                               FieldIDMapper fm)
create a Datum matching RecordDescriptor, based on FieldIDMapper, init to Datum.


createDataBlock

public final DataBlock createDataBlock(ISBounds bnds)
create a DataBlock matching RecordDescriptor.


createDataBlock

public final DataBlock createDataBlock(ISBounds bnds,
                                       RecordSpec rs)
create a DataBlock matching RecordDescriptor, adjusted by RecordSpec.


createDataBlock

public final DataBlock createDataBlock(ISBounds bnds,
                                       FieldIDMapper fm)
create a DataBlock matching RecordDescr adjusted by FieldIDMapper.


getDouble

public double getDouble(IndexSpaceID isid,
                        int attr)
Return the field specified by the arguments as a double.


getFloat

public float getFloat(IndexSpaceID isid,
                      int attr)
Return the field specified by the arguments as a float.


getInt

public int getInt(IndexSpaceID isid,
                  int attr)
Return the field specified by the arguments as an int.


getShort

public short getShort(IndexSpaceID isid,
                      int attr)
Return the field specified by the arguments as a short.


getByte

public byte getByte(IndexSpaceID isid,
                    int attr)
Return the field specified by the arguments as a byte.


getDoubles

public double[] getDoubles(IndexSpaceID isid)
Return all attributes of the Datum at the as a 1-d double array


getDoubles

public 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.


getFloats

public float[] getFloats(IndexSpaceID isid)
Return all attributes of the Datum as a 1-d float array


getFloats

public 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.


getInts

public int[] getInts(IndexSpaceID isid)
Return all attributes of the Datum as a 1-d int array


getInts

public 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.


getShorts

public short[] getShorts(IndexSpaceID isid)
Return all attributes of the Datum as a 1-d short array


getShorts

public 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.


getBytes

public byte[] getBytes(IndexSpaceID isid)
Return all attributes of the Datum as a single byte array


getBytes

public 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.


getDoubles

public double[] getDoubles(int attr)
Return a 1-d double array containing all values of the specified attribute using the existing axis axisOrdering.


getDoubles

public 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. The passed array is returned, but if it is null or not the right size a new array is created and returned.


getFloats

public float[] getFloats(int attr)
Return a 1-d float array containing all values of the specified attribute using the existing axis axisOrdering.


getFloats

public 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. The passed array is returned, but if it is null or not the right size a new array is created and returned.


getInts

public int[] getInts(int attr)
Return a 1-d int array containing all values of the specified attribute using the existing axis axisOrdering.


getInts

public 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. The passed array is returned, but if it is null or not the right size a new array is created and returned.


getShorts

public short[] getShorts(int attr)
Return a 1-d short array containing all values of the specified attribute using the existing axis axisOrdering.


getShorts

public 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. The passed array is returned, but if it is null or not the right size a new array is created and returned.


getBytes

public byte[] getBytes(int attr)
Return a 1-d byte array containing all values of the specified attribute using the existing axis axisOrdering.


getBytes

public 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. The passed array is returned, but if it is null or not the right size a new array is created and returned.


getDoubles

public double[] getDoubles()
Return a 1-d double array containing all values of all attributes using the existing axis axisOrdering and data axisOrdering (attribute vs. point). The returned array may be a reference to the actual data.


getDoubles

public 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. point). The passed array is returned for convenience. If the passed array is null or is not long of correct length, a warning is issued, and a new array of correct length is created and returned.


getDoublesByAttribute

public double[] getDoublesByAttribute()
Return a 1-d double array containing all values of all attributes in attribute order using the existing axis axisOrdering. The returned array may be a reference to the actual data.


getDoublesByAttribute

public 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. point). The passed array is returned for convenience. If the passed array is null or is not long of correct length, a warning is issued, and a new array of correct length is created and returned.


getDoublesByPoint

public double[] getDoublesByPoint()
Return a 1-d double array containing all values of all attributes in point order using the existing axis axisOrdering. The returned array may be a reference to the actual data.


getDoublesByPoint

public double[] getDoublesByPoint(double[] filler)
Fill a 1-d array containing all values of all attributes using the existing axis axisOrdering and attribute data axisOrdering. The passed array is returned for convenience. If the passed array is null or is not long of correct length, a warning is issued, and a new array of correct length is created and returned.


getFloats

public float[] getFloats()
Return a 1-d float array containing all values of all attributes using the existing axis axisOrdering and data axisOrdering (attribute vs. point). The returned array may be a reference to the actual data.


getFloats

public 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. point). The passed array is returned for convenience. If the passed array is null or is not long of correct length, a warning is issued, and a new array of correct length is created and returned.


getFloatsByAttribute

public float[] getFloatsByAttribute()
Return a 1-d float array containing all values of all attributes in attribute order using the existing axis axisOrdering. The returned array may be a reference to the actual data.


getFloatsByPoint

public float[] getFloatsByPoint()
Return a 1-d float array containing all values of all attributes in point order using the existing axis axisOrdering. The returned array may be a reference to the actual data.


getFloatsByAttribute

public 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. point). The passed array is returned for convenience. If the passed array is null or is not long of correct length, a warning is issued, and a new array of correct length is created and returned.


getFloatsByPoint

public float[] getFloatsByPoint(float[] filler)
Fill a 1-d array containing all values of all attributes using the existing axis axisOrdering and attribute data axisOrdering. The passed array is returned for convenience. If the passed array is null or is not long of correct length, a warning is issued, and a new array of correct length is created and returned.


getInts

public int[] getInts()
Return a 1-d int array containing all values of all attributes using the existing axis axisOrdering and data axisOrdering (attribute vs. point). The returned array may be a reference to the actual data.


getInts

public 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. point). The passed array is returned for convenience. If the passed array is null or is not long of correct length, a warning is issued, and a new array of correct length is created and returned.


getIntsByAttribute

public int[] getIntsByAttribute()
Return a 1-d int array containing all values of all attributes in attribute order using the existing axis axisOrdering. The returned array may be a reference to the actual data.


getIntsByPoint

public int[] getIntsByPoint()
Return a 1-d int array containing all values of all attributes in point order using the existing axis axisOrdering. The returned array may be a reference to the actual data.


getIntsByAttribute

public 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. point). The passed array is returned for convenience. If the passed array is null or is not long of correct length, a warning is issued, and a new array of correct length is created and returned.


getIntsByPoint

public int[] getIntsByPoint(int[] filler)
Fill a 1-d array containing all values of all attributes using the existing axis axisOrdering and attribute data axisOrdering. The passed array is returned for convenience. If the passed array is null or is not long of correct length, a warning is issued, and a new array of correct length is created and returned.


getShorts

public short[] getShorts()
Return a 1-d short array containing all values of all attributes using the existing axis axisOrdering and data axisOrdering (attribute vs. point). The returned array may be a reference to the actual data.


getShorts

public 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. point). The passed array is returned for convenience. If the passed array is null or is not long of correct length, a warning is issued, and a new array of correct length is created and returned.


getShortsByAttribute

public short[] getShortsByAttribute()
Return a 1-d short array containing all values of all attributes in attribute order using the existing axis axisOrdering. The returned array may be a reference to the actual data.


getShortsByPoint

public short[] getShortsByPoint()
Return a 1-d short array containing all values of all attributes in point order using the existing axis axisOrdering. The returned array may be a reference to the actual data.


getShortsByAttribute

public 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. point). The passed array is returned for convenience. If the passed array is null or is not long of correct length, a warning is issued, and a new array of correct length is created and returned.


getShortsByPoint

public short[] getShortsByPoint(short[] filler)
Fill a 1-d array containing all values of all attributes using the existing axis axisOrdering and attribute data axisOrdering. The passed array is returned for convenience. If the passed array is null or is not long of correct length, a warning is issued, and a new array of correct length is created and returned.


getBytes

public byte[] getBytes()
Return a 1-d byte array containing all values of all attributes using the existing axis axisOrdering and data axisOrdering (attribute vs. point). The returned array may be a reference to the actual data.


getBytes

public 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. point). The passed array is returned for convenience. If the passed array is null or is not long of correct length, a warning is issued, and a new array of correct length is created and returned.


getBytesByAttribute

public byte[] getBytesByAttribute()
Return a 1-d byte array containing all values of all attributes in attribute order using the existing axis axisOrdering. The returned array may be a reference to the actual data.


getBytesByPoint

public byte[] getBytesByPoint()
Return a 1-d byte array containing all values of all attributes in point order using the existing axis axisOrdering. The returned array may be a reference to the actual data.


getBytesByAttribute

public 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. point). The passed array is returned for convenience. If the passed array is null or is not long of correct length, a warning is issued, and a new array of correct length is created and returned.


getBytesByPoint

public byte[] getBytesByPoint(byte[] filler)
Fill a 1-d array containing all values of all attributes using the existing axis axisOrdering and attribute data axisOrdering. The passed array is returned for convenience. If the passed array is null or is not long of correct length, a warning is issued, and a new array of correct length is created and returned.


getValues

public 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). The default implementation is often overridden for efficiency.


getValuesByAttribute

public Values getValuesByAttribute()
Return a Values array of all attributes in their internal type in the attribute order. The returned result may be a reference to the actual data if it is possible, or a copy of the data reorganized to match the desired order.


getValuesByPoint

public Values getValuesByPoint()
Return a Values array of all attributes in their internal type in the point order. The returned result may be a reference to the actual data if it is possible, or a copy of the data reorganized to match the desired order.


getValues

public Values getValues(int attr)
Return a Values array of the specified attribute in whatever type it has internally. This could be a reference to the actual data. The implementation in this class is a default that is expected to be overridden in children classes for performance.