edu.unh.sdb.datasource
Class DataBlock

java.lang.Object
  extended by edu.unh.sdb.datasource.DataCollection
      extended by edu.unh.sdb.datasource.DataBlock
All Implemented Interfaces:
Indexable
Direct Known Subclasses:
ARBlock, BasicBlock, CellBlock, CompositeBlock, DataBlockProxy, DatumBlock, ObliquePlaneIterator, RayCellIterator, VRDataBlock

public abstract class DataBlock
extends DataCollection

An abstract parent class for datablocks--used to transport blocks of data around the system


Field Summary
 
Fields inherited from class edu.unh.sdb.datasource.DataCollection
attributeOrder, axisOrdering, axisWeights, bounds, dataOrder, dimensionality, numAttributes, pointOrder, recordDesc
 
Constructor Summary
protected DataBlock()
          Empty Constructor
  DataBlock(DataBlock b)
          Construct a DataBlock from the given DataBlock.
  DataBlock(ISBounds isb, AxisOrdering ordering, RecordDescriptor recordDesc)
          Deprecated. Use DataBlock( ISBounds, RecordDescriptor, AxisOrdering )
  DataBlock(ISBounds isb, RecordDescriptor recordDesc)
          Construct a datablock with the given bounds and number of attributes.
  DataBlock(ISBounds isb, RecordDescriptor recordDesc, AxisOrdering ordering)
          Construct a datablock with the given bounds, axis axisOrdering and RecordDescriptor.
 
Method Summary
 Values getValues()
          Returns a Values array which encapsulates a 1D array of the data values in the block with one entry for every point in the block.
protected  void setByAttribute(Values vals)
           
 void setByte(IndexSpaceID isid, int attr, byte v)
          For the position of the 1st argument, set the attribute specified by the 2nd argument to the value of the 3rd argument.
 void setBytes(IndexSpaceID isid, byte[] newVals)
          Set all attributes of the Datum at the specified isid to the values in passed array.
 void setBytes(int attr, byte[] newVals)
          Set the specified attribute of the Datum at all points to the values in passed attribute array.
 void setBytesByAttribute(byte[] newVals)
          Set all the attributes of all points in the block.
 void setBytesByPoint(byte[] newVals)
          Set all the attributes of all points in the block.
abstract  void setDatum(IndexSpaceID isid, Datum d)
          Set the location specified by the IndexSpaceID to the given datum.
 void setDouble(IndexSpaceID isid, int attr, double v)
          For the position of the 1st argument, set the attribute specified by the 2nd argument to the value of the 3rd argument.
 void setDoubles(IndexSpaceID isid, double[] newVals)
          Set all attributes of the Datum at the specified isid to the values in passed array.
 void setDoubles(int attr, double[] newVals)
          Set the specified attribute of the Datum at all points to the values in passed attribute array.
 void setDoublesByAttribute(double[] newVals)
          Set all the attributes of all points in the block.
 void setDoublesByPoint(double[] newVals)
          Set all the attributes of all points in the block.
 void setFloat(IndexSpaceID isid, int attr, float v)
          For the position of the 1st argument, set the attribute specified by the 2nd argument to the value of the 3rd argument.
 void setFloats(IndexSpaceID isid, float[] newVals)
          Set all attributes of the Datum at the specified isid to the values in passed array.
 void setFloats(int attr, float[] newVals)
          Set the specified attribute of the Datum at all points to the values in passed attribute array.
 void setFloatsByAttribute(float[] newVals)
          Set all the attributes of all points in the block.
 void setFloatsByPoint(float[] newVals)
          Set all the attributes of all points in the block.
 void setInt(IndexSpaceID isid, int attr, int v)
          For the position of the 1st argument, set the attribute specified by the 2nd argument to the value of the 3rd argument.
 void setInts(IndexSpaceID isid, int[] newVals)
          Set all attributes of the Datum at the specified isid to the values in passed array.
 void setInts(int attr, int[] newVals)
          Set the specified attribute of the Datum at all points to the values in passed attribute array.
 void setIntsByAttribute(int[] newVals)
          Set all the attributes of all points in the block.
 void setIntsByPoint(int[] newVals)
          Set all the attributes of all points in the block.
 void setShort(IndexSpaceID isid, int attr, short v)
          For the position of the 1st argument, set the attribute specified by the 2nd argument to the value of the 3rd argument.
 void setShorts(IndexSpaceID isid, short[] newVals)
          Set all attributes of the Datum at the specified isid to the values in passed array.
 void setShorts(int attr, short[] newVals)
          Set the specified attribute of the Datum at all points to the values in passed attribute array.
 void setShortsByAttribute(short[] newVals)
          Set all the attributes of all points in the block.
 void setShortsByPoint(short[] newVals)
          Set all the attributes of all points in the block.
 void setValues(int attr, Values newVals)
          Set the specified attribute of the Datum at all points to the values in passed Values object.
protected  boolean setValues(Values vals)
          Set all the attributes of all points in the block.
 void setValuesByAttribute(Values vals)
          Set all the attributes of all points in the block.
 void setValuesByPoint(Values vals)
          Set all the attributes of all points in the block.
 java.lang.String toString()
          Write the values of the entire DataBlock index space to a string in a nice format.
 
Methods inherited from class edu.unh.sdb.datasource.DataCollection
byteSize, computeOffset, computeOffset, copyBounds, createDataBlock, createDataBlock, createDataBlock, createDatum, createDatum, createDatum, createDatum, createDatum, createDatum, datum, datum, datum, datum, datum, datum, datum, dim, getAxisOrdering, getAxisWeight, getAxisWeights, getBounds, getByte, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytesByAttribute, getBytesByAttribute, getBytesByPoint, getBytesByPoint, getDataOrder, getDimensionsArray, getDouble, getDoubles, getDoubles, getDoubles, getDoubles, getDoubles, getDoubles, getDoublesByAttribute, getDoublesByAttribute, getDoublesByPoint, getDoublesByPoint, getFloat, getFloats, getFloats, getFloats, getFloats, getFloats, getFloats, getFloatsByAttribute, getFloatsByAttribute, getFloatsByPoint, getFloatsByPoint, getInt, getInts, getInts, getInts, getInts, getInts, getInts, getIntsByAttribute, getIntsByAttribute, getIntsByPoint, getIntsByPoint, getLowerBoundsArray, getNumAttributes, getRecordDescriptor, getShort, getShorts, getShorts, getShorts, getShorts, getShorts, getShorts, getShortsByAttribute, getShortsByAttribute, getShortsByPoint, getShortsByPoint, getStorageType, getValues, getValuesByAttribute, getValuesByPoint, longVolume, setAxisOrdering, setBounds, setRecordDescriptor, size, subblock, subblock, subblock, subblock, subblock, subblock, subblock, subblock, subblock, subblock, subblock, subblock, useBytesOnly, volume
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataBlock

protected DataBlock()
Empty Constructor


DataBlock

public DataBlock(ISBounds isb,
                 AxisOrdering ordering,
                 RecordDescriptor recordDesc)
Deprecated. Use DataBlock( ISBounds, RecordDescriptor, AxisOrdering )

Construct a datablock with the given bounds, axis axisOrdering and RecordDescriptor. The bounds will be moved to the origin.


DataBlock

public DataBlock(ISBounds isb,
                 RecordDescriptor recordDesc,
                 AxisOrdering ordering)
Construct a datablock with the given bounds, axis axisOrdering and RecordDescriptor. The bounds will be moved to the origin.


DataBlock

public DataBlock(ISBounds isb,
                 RecordDescriptor recordDesc)
Construct a datablock with the given bounds and number of attributes. The default axis axisOrdering is used, and the bounds will be moved to the origin.


DataBlock

public DataBlock(DataBlock b)
Construct a DataBlock from the given DataBlock. Bounds, Ordering, and RecordDescriptor will be copied directly from the DataBlock argument. This is faster than using one of the constructors above.

Method Detail

getValues

public Values getValues()
Returns a Values array which encapsulates a 1D array of the data values in the block with one entry for every point in the block. The type of the Values object is determined by the underlying storage type(s) needed. This default implementation returns the Values in the order and type defined by the block. This implementation is expected to be overridden by the child classes for efficiency.

Specified by:
getValues in class DataCollection

setDatum

public abstract void setDatum(IndexSpaceID isid,
                              Datum d)
Set the location specified by the IndexSpaceID to the given datum.


setDouble

public void setDouble(IndexSpaceID isid,
                      int attr,
                      double v)
For the position of the 1st argument, set the attribute specified by the 2nd argument to the value of the 3rd argument.


setFloat

public void setFloat(IndexSpaceID isid,
                     int attr,
                     float v)
For the position of the 1st argument, set the attribute specified by the 2nd argument to the value of the 3rd argument.


setInt

public void setInt(IndexSpaceID isid,
                   int attr,
                   int v)
For the position of the 1st argument, set the attribute specified by the 2nd argument to the value of the 3rd argument.


setShort

public void setShort(IndexSpaceID isid,
                     int attr,
                     short v)
For the position of the 1st argument, set the attribute specified by the 2nd argument to the value of the 3rd argument.


setByte

public void setByte(IndexSpaceID isid,
                    int attr,
                    byte v)
For the position of the 1st argument, set the attribute specified by the 2nd argument to the value of the 3rd argument.


setDoubles

public void setDoubles(IndexSpaceID isid,
                       double[] newVals)
Set all attributes of the Datum at the specified isid to the values in passed array. Convert as needed to internal type. If the passed array is too short, remaining attributes are left unchanged. If the passed array is too long, the values are updated, and a recoverable error is generated.


setFloats

public void setFloats(IndexSpaceID isid,
                      float[] newVals)
Set all attributes of the Datum at the specified isid to the values in passed array. Convert as needed to internal type. If the passed array is too short, remaining attributes are left unchanged. If the passed array is too long, the values are updated, and a recoverable error is generated.


setInts

public void setInts(IndexSpaceID isid,
                    int[] newVals)
Set all attributes of the Datum at the specified isid to the values in passed array. Convert as needed to internal type. If the passed array is too short, remaining attributes are left unchanged. If the passed array is too long, the values are updated, and a recoverable error is generated.


setShorts

public void setShorts(IndexSpaceID isid,
                      short[] newVals)
Set all attributes of the Datum at the specified isid to the values in passed array. Convert as needed to internal type. If the passed array is too short, remaining attributes are left unchanged. If the passed array is too long, the values are updated, and a recoverable error is generated.


setBytes

public void setBytes(IndexSpaceID isid,
                     byte[] newVals)
Set all attributes of the Datum at the specified isid to the values in passed array. Convert as needed to internal type. If the passed array is too short, remaining attributes are left unchanged. If the passed array is too long, the values are updated, and a recoverable error is generated.


setDoubles

public void setDoubles(int attr,
                       double[] newVals)
Set the specified attribute of the Datum at all points to the values in passed attribute array. Convert as needed to internal type. If the passed array is too short, remaining attributes are left unchanged. If the passed array is too long, the values are updated, and a recoverable error is generated.


setFloats

public void setFloats(int attr,
                      float[] newVals)
Set the specified attribute of the Datum at all points to the values in passed attribute array. Convert as needed to internal type. If the passed array is too short, remaining attributes are left unchanged. If the passed array is too long, the values are updated, and a recoverable error is generated.


setInts

public void setInts(int attr,
                    int[] newVals)
Set the specified attribute of the Datum at all points to the values in passed attribute array. Convert as needed to internal type. If the passed array is too short, remaining attributes are left unchanged. If the passed array is too long, the values are updated, and a recoverable error is generated.


setShorts

public void setShorts(int attr,
                      short[] newVals)
Set the specified attribute of the Datum at all points to the values in passed attribute array. Convert as needed to internal type. If the passed array is too short, remaining attributes are left unchanged. If the passed array is too long, the values are updated, and a recoverable error is generated.


setBytes

public void setBytes(int attr,
                     byte[] newVals)
Set the specified attribute of the Datum at all points to the values in passed attribute array. Convert as needed to internal type. If the passed array is too short, remaining attributes are left unchanged. If the passed array is too long, the values are updated, and a recoverable error is generated.


setValues

public void setValues(int attr,
                      Values newVals)
Set the specified attribute of the Datum at all points to the values in passed Values object. Convert as needed to internal type. If the passed array is too short, remaining attributes are left unchanged. If the passed array is too long, the values are updated, and a recoverable error is generated.


setValuesByPoint

public void setValuesByPoint(Values vals)
Set all the attributes of all points in the block. The input Values object is organized by point. Convert as needed to internal storage order and internal type. If the input array is not the right size an exception is thrown.


setValuesByAttribute

public void setValuesByAttribute(Values vals)
Set all the attributes of all points in the block. The input Values object is organized by attribute. Convert as needed to internal storage order and internal type. If the input array is not the right size an exception is thrown.


setByAttribute

protected void setByAttribute(Values vals)

setDoublesByPoint

public void setDoublesByPoint(double[] newVals)
Set all the attributes of all points in the block. The input array is organized by point. Convert as needed to internal storage order and internal type. If the array is not the right size, an exception is thrown.


setDoublesByAttribute

public void setDoublesByAttribute(double[] newVals)
Set all the attributes of all points in the block. The input array is organized by attribute. Convert as needed to internal storage order and internal type. If the array is not the right size, an exception is thrown.


setFloatsByPoint

public void setFloatsByPoint(float[] newVals)
Set all the attributes of all points in the block. The input array is organized by point. Convert as needed to internal storage order and internal type. If the array is not the right size, an exception is thrown.


setFloatsByAttribute

public void setFloatsByAttribute(float[] newVals)
Set all the attributes of all points in the block. The input array is organized by attribute. Convert as needed to internal storage order and internal type. If the array is not the right size, an exception is thrown.


setIntsByPoint

public void setIntsByPoint(int[] newVals)
Set all the attributes of all points in the block. The input array is organized by point. Convert as needed to internal storage order and internal type. If the array is not the right size, an exception is thrown.


setIntsByAttribute

public void setIntsByAttribute(int[] newVals)
Set all the attributes of all points in the block. The input array is organized by attribute. Convert as needed to internal storage order and internal type. If the array is not the right size, an exception is thrown.


setShortsByPoint

public void setShortsByPoint(short[] newVals)
Set all the attributes of all points in the block. The input array is organized by point. Convert as needed to internal storage order and internal type. If the array is not the right size, an exception is thrown.


setShortsByAttribute

public void setShortsByAttribute(short[] newVals)
Set all the attributes of all points in the block. The input array is organized by attribute. Convert as needed to internal storage order and internal type. If the array is not the right size, an exception is thrown.


setBytesByPoint

public void setBytesByPoint(byte[] newVals)
Set all the attributes of all points in the block. The input array is organized by point. Convert as needed to internal storage order and internal type. If the array is not the right size, an exception is thrown.


setBytesByAttribute

public void setBytesByAttribute(byte[] newVals)
Set all the attributes of all points in the block. The input array is organized by attribute. Convert as needed to internal storage order and internal type. If the array is not the right size, an exception is thrown.


setValues

protected boolean setValues(Values vals)
Set all the attributes of all points in the block. Convert as needed to internal type. If the class does not support this mechanism, the return value is false, which is the default implementation.


toString

public java.lang.String toString()
Write the values of the entire DataBlock index space to a string in a nice format. Uses the default axisOrdering.

Overrides:
toString in class java.lang.Object