edu.unh.sdb.datasource
Class VRIndexable

java.lang.Object
  extended by edu.unh.sdb.datasource.DataCollection
      extended by edu.unh.sdb.datasource.VRIndexable
All Implemented Interfaces:
Indexable

public class VRIndexable
extends DataCollection

VRIndexable provides different resolution view of the datasource. It can be built on top of any datasource to view the datasource with different resolution level. The resolution level is a integer number which can be incremented and decrease by VRDS' function call. Negative numbers mean the current resolution coarser than the datasource's original resolution. It also means the current VRDS has less data points than the original datasource. Positive numbers' meaning is opposite.


Field Summary
protected  int base_resolution
           
protected  ISBounds bounds
           
protected  int dimensionality
           
protected  ISIDMapper mapper
           
protected  RecordDescriptor recordDesc
           
protected  int res_level
           
protected  DataCollection source_dc
           
 
Fields inherited from class edu.unh.sdb.datasource.DataCollection
attributeOrder, axisOrdering, axisWeights, dataOrder, numAttributes, pointOrder
 
Constructor Summary
VRIndexable(DataCollection dc)
          Construct a VRDataSource from any source datasource.
VRIndexable(DataCollection dc, int base_res)
          Construct a VRdataSource and set it to a certain resolution level.
VRIndexable(DataCollection dc, ISBounds res)
          Construct a VRdataSource and set its resolution corresponding to the given ISBounds argument.
 
Method Summary
 void datum(Datum dtm, IndexSpaceID did)
          Return by reference the Datum corresponding to the given IndexSpaceID.
 void datum(Datum dtm, IndexSpaceID did, FieldIDMapper mp)
          Get the Datum and fill its values in the passed Datum at positions specified by the corresponding FieldIDMapper.
 void datum(Datum dtm, IndexSpaceID did, RecordSpec recSpec)
          Get the Datum and fill its values in the passed Datum at positions specified by the corresponding RecordSpec.
 Datum datum(IndexSpaceID did)
          Return the Datum corresponding to the given IndexSpaceID and current resolution level, using the ISIDMapper.
 Datum datum(IndexSpaceID did, RecordSpec spec)
          Return the attribute projected Datum corresponding to the given IndexSpaceID and current resolution level, using the ISIDMapper.
 boolean decr()
          Decrease Resolution Level by 1
 ISIDMapper getMapper()
          Get the mapper
 Indexable getSource()
          Get source
 Indexable getSourceIndexable()
          Return the DataSource on which this VRDS is built
 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).
 boolean incr()
          Increase Resolution Level by 1
static void main(java.lang.String[] args)
           
 void subblock(DataBlock blk, ISBounds dstBounds, ISBounds srcBounds)
          Reads a subblock defined by srcBounds into the region of the Datablock argument defined by dstBounds.
 void subblock(DataBlock blk, ISBounds dstISB, ISBounds srcISB, FieldIDMapper mp)
          Reads a subblock defined by srcISB into the region of the Datablock argument defined by dstISB.
 void subblock(DataBlock blk, ISBounds dstISB, ISBounds srcISB, RecordSpec spec)
          Reads a subblock defined by srcISB into the region of the Datablock argument defined by dstISB.
 java.lang.String toString()
          Return the description of the VRDS
 
Methods inherited from class edu.unh.sdb.datasource.DataCollection
byteSize, computeOffset, computeOffset, copyBounds, createDataBlock, createDataBlock, createDataBlock, createDatum, createDatum, createDatum, createDatum, createDatum, createDatum, 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, useBytesOnly, volume
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

source_dc

protected DataCollection source_dc

mapper

protected ISIDMapper mapper

res_level

protected int res_level

base_resolution

protected int base_resolution

bounds

protected ISBounds bounds

dimensionality

protected int dimensionality

recordDesc

protected RecordDescriptor recordDesc
Constructor Detail

VRIndexable

public VRIndexable(DataCollection dc)
Construct a VRDataSource from any source datasource.


VRIndexable

public VRIndexable(DataCollection dc,
                   int base_res)
Construct a VRdataSource and set it to a certain resolution level.


VRIndexable

public VRIndexable(DataCollection dc,
                   ISBounds res)
Construct a VRdataSource and set its resolution corresponding to the given ISBounds argument.

Method Detail

getSource

public Indexable getSource()
Get source


getMapper

public ISIDMapper getMapper()
Get the mapper


datum

public void datum(Datum dtm,
                  IndexSpaceID did)
Return by reference the Datum corresponding to the given IndexSpaceID.

Specified by:
datum in interface Indexable
Overrides:
datum in class DataCollection

datum

public void datum(Datum dtm,
                  IndexSpaceID did,
                  FieldIDMapper mp)
Get the Datum and fill its values in the passed Datum at positions specified by the corresponding FieldIDMapper.

Specified by:
datum in interface Indexable
Specified by:
datum in class DataCollection

datum

public void datum(Datum dtm,
                  IndexSpaceID did,
                  RecordSpec recSpec)
Get the Datum and fill its values in the passed Datum at positions specified by the corresponding RecordSpec.

Specified by:
datum in interface Indexable
Overrides:
datum in class DataCollection

datum

public Datum datum(IndexSpaceID did)
Return the Datum corresponding to the given IndexSpaceID and current resolution level, using the ISIDMapper.

Specified by:
datum in interface Indexable
Overrides:
datum in class DataCollection

datum

public Datum datum(IndexSpaceID did,
                   RecordSpec spec)
Return the attribute projected Datum corresponding to the given IndexSpaceID and current resolution level, using the ISIDMapper.

Specified by:
datum in interface Indexable
Overrides:
datum in class DataCollection

incr

public boolean incr()
Increase Resolution Level by 1


decr

public boolean decr()
Decrease Resolution Level by 1


getValues

public 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). If the VRIndexable is a DataSource that is very large, this implementation could be a problem since it just makes a single DataBlock and does a getValues on that.

Specified by:
getValues in class DataCollection

subblock

public void subblock(DataBlock blk,
                     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
Specified by:
subblock in class DataCollection

subblock

public void subblock(DataBlock blk,
                     ISBounds dstISB,
                     ISBounds srcISB,
                     RecordSpec spec)
Reads a subblock defined by srcISB into the region of the Datablock argument defined by dstISB. The RecordSpec argument specifies a subset of the DataSource attributes to be written into the DataBlock datums.

Specified by:
subblock in interface Indexable
Overrides:
subblock in class DataCollection

subblock

public void subblock(DataBlock blk,
                     ISBounds dstISB,
                     ISBounds srcISB,
                     FieldIDMapper mp)
Reads a subblock defined by srcISB into the region of the Datablock argument defined by dstISB. The FieldIDMapper argument determines the mapping between datums in the datasource and datums in the DataBlock.

Specified by:
subblock in interface Indexable
Specified by:
subblock in class DataCollection

getSourceIndexable

public Indexable getSourceIndexable()
Return the DataSource on which this VRDS is built


toString

public java.lang.String toString()
Return the description of the VRDS

Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)