edu.unh.sdb.datasource
Class AttributeJoinDataSource

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

public class AttributeJoinDataSource
extends CompositeDataSource

This class creates a new DataSource by joining attributes of some DataSources.


Field Summary
 
Fields inherited from class edu.unh.sdb.datasource.CompositeDataSource
componentInfos
 
Fields inherited from class edu.unh.sdb.datasource.DataSource
fdlDescriptor, isActivated, name, wsName
 
Fields inherited from class edu.unh.sdb.datasource.DataCollection
attributeOrder, axisOrdering, axisWeights, bounds, dataOrder, dimensionality, numAttributes, pointOrder, recordDesc
 
Constructor Summary
AttributeJoinDataSource(java.lang.String aname, ComponentInfo[] cinfo)
          Construct a new AJDS from the given name and an array of ComponentInfos.
AttributeJoinDataSource(java.lang.String aname, DataSource[] sources)
          This constructor joins all the attributes of the given congruent DataSources.
AttributeJoinDataSource(java.lang.String aname, DataSource[] sources, FieldIDMapper[] FIDmap, ISBounds[] componentBounds, ISBounds compositeBounds)
          Construct a new AJDS from the given name, information of the components and the ISBounds of this new AJDS.
AttributeJoinDataSource(java.lang.String aname, DataSource[] sources, ISBounds compositeBounds)
          This constructor joins all the attributes of the given congruent distinct DataSources.
AttributeJoinDataSource(java.lang.String aname, DataSource[] sources, ISBounds[] componentBounds)
          Construct a new AJDS by joining all the attributes of the subsets specified by the given ISBounds array and the corresponding DataSource array.
AttributeJoinDataSource(java.lang.String aname, DataSource[] sources, ISBounds[] componentBounds, ISBounds compositeBounds)
          Construct a new AJDS by joining all the attributes of the subsets specified by the given ISBounds array and the corresponding DataSource array.
 
Method Summary
 void activate()
          Overrides from DataSource.
protected  boolean check(ComponentInfo[] cpnInfos)
          Check the array of ComponentInfo for AJDS.
static ComponentInfo[] createComponentInfos(DataSource[] sources, FieldIDMapper[] FIDmap, ISBounds[] componentBounds, ISBounds compositeBounds)
          Creates an array of ComponentInfo from the given information for each component.
 void datum(Datum dtm, IndexSpaceID did)
          Return the Datum by reference
 void datum(Datum dtm, IndexSpaceID did, FieldIDMapper mp)
          Deprecated.  
 void datum(Datum dtm, IndexSpaceID did, RecordSpec spec)
          Reads a subset of the DataSource attributes specified by the RecordSpec argument to the Datum argument defined by IndexSpaceID did.
 Datum datum(IndexSpaceID did)
          Overrides from DataSource.
 Datum datum(IndexSpaceID did, RecordSpec spec)
          This datum method returns values of a subset of all the attributes.
protected  void initializeComponents(ComponentInfo[] cpnInfo)
          initialize component-related members that are not initialized by super
static void main(java.lang.String[] args)
          AttributeJoinDataSource main test
 void subblock(DataBlock theBlock, ISBounds dstBounds, ISBounds srcBounds)
          Reads a subblock defined by srcBounds into the region of the Datablock argument defined by dstBounds.
 void subblock(DataBlock theBlock, ISBounds dstBounds, ISBounds srcBounds, FieldIDMapper mp)
          Deprecated.  
 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.
 DataBlock subblock(ISBounds db)
          Get a block of datums.
 DataBlock subblock(ISBounds db, RecordSpec spec)
          Get a block of datums with a subset of all the attributes
 DataSource subset(ISBounds db)
           
 DataSource subset(RecordDescriptor rd)
           
 DataSource subset(RecordDescriptor rd, ISBounds db)
           
static void test1()
          Tests AttributeJoinDataSource.
static void test2(java.lang.String[] argv)
          Test AttributeJoinDataSource
 java.lang.String toString()
          Print the data members of the DataSource in an easy to read fashion.
 
Methods inherited from class edu.unh.sdb.datasource.CompositeDataSource
deactivate, equals, getComponentBounds, getComponentDataSources, getComponentFieldIDs, getComponentInfos, getCompositeBounds, getCompositeFieldIDs, getFIDMappers
 
Methods inherited from class edu.unh.sdb.datasource.DataSource
checkActivated, clearCache, copyBestID, create, create, create, createRemote, createRemote, createRemoteClient, createRemoteClient, createRemoteDataSource, createRemoteDataSource, createRemoteDataSourceUDP, createRemoteUDP, createRemoteUDP, dumpData, getName, getValues, isActivated, toString
 
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, useBytesOnly, volume
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeJoinDataSource

public AttributeJoinDataSource(java.lang.String aname,
                               ComponentInfo[] cinfo)
Construct a new AJDS from the given name and an array of ComponentInfos.


AttributeJoinDataSource

public AttributeJoinDataSource(java.lang.String aname,
                               DataSource[] sources,
                               FieldIDMapper[] FIDmap,
                               ISBounds[] componentBounds,
                               ISBounds compositeBounds)
Construct a new AJDS from the given name, information of the components and the ISBounds of this new AJDS. The given arrays are parallel to the array of components (or ComponentInfos).


AttributeJoinDataSource

public AttributeJoinDataSource(java.lang.String aname,
                               DataSource[] sources)
This constructor joins all the attributes of the given congruent DataSources. The attributes of the component DataSources are concatenated in the sequence of array index. The given DataSource array is parallel to the array of components (or ComponentInfos).


AttributeJoinDataSource

public AttributeJoinDataSource(java.lang.String aname,
                               DataSource[] sources,
                               ISBounds[] componentBounds)
Construct a new AJDS by joining all the attributes of the subsets specified by the given ISBounds array and the corresponding DataSource array. The given arrays are parallel to the array of components (or ComponentInfos).


AttributeJoinDataSource

public AttributeJoinDataSource(java.lang.String aname,
                               DataSource[] sources,
                               ISBounds compositeBounds)
This constructor joins all the attributes of the given congruent distinct DataSources. The attributes of the component DataSources are concatenated in the sequence of array index. The given DataSource array is parallel to the array of components (or ComponentInfos). The ISBounds of this new AJDS is the given ISBounds.


AttributeJoinDataSource

public AttributeJoinDataSource(java.lang.String aname,
                               DataSource[] sources,
                               ISBounds[] componentBounds,
                               ISBounds compositeBounds)
Construct a new AJDS by joining all the attributes of the subsets specified by the given ISBounds array and the corresponding DataSource array. The ISBounds of this new AJDS is the given ISBounds. The given arrays are parallel to the array of components (or ComponentInfos).

Method Detail

createComponentInfos

public static ComponentInfo[] createComponentInfos(DataSource[] sources,
                                                   FieldIDMapper[] FIDmap,
                                                   ISBounds[] componentBounds,
                                                   ISBounds compositeBounds)
Creates an array of ComponentInfo from the given information for each component. The given arrays should be parallel to the returned array if provided (not null). The elements in the given DataSource array may have duplicates.


initializeComponents

protected void initializeComponents(ComponentInfo[] cpnInfo)
initialize component-related members that are not initialized by super

Specified by:
initializeComponents in class CompositeDataSource

check

protected boolean check(ComponentInfo[] cpnInfos)
Check the array of ComponentInfo for AJDS.

Specified by:
check in class CompositeDataSource

activate

public void activate()
Overrides from DataSource.

Overrides:
activate in class CompositeDataSource

datum

public Datum datum(IndexSpaceID did)
Overrides from DataSource.

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

datum

public Datum datum(IndexSpaceID did,
                   RecordSpec spec)
This datum method returns values of a subset of all the attributes. This subset is specified by RecordSpec spec.

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

datum

public void datum(Datum dtm,
                  IndexSpaceID did)
Return the Datum by reference

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

datum

public void datum(Datum dtm,
                  IndexSpaceID did,
                  FieldIDMapper mp)
Deprecated. 

Fill 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 spec)
Reads a subset of the DataSource attributes specified by the RecordSpec argument to the Datum argument defined by IndexSpaceID did.

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

subblock

public DataBlock subblock(ISBounds db)
Get a block of datums. The lower bound is always origin.

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

subblock

public DataBlock subblock(ISBounds db,
                          RecordSpec spec)
Get a block of datums with a subset of all the attributes

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

subblock

public 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
Specified by:
subblock in class DataCollection

subblock

public void subblock(DataBlock theBlock,
                     ISBounds dstBounds,
                     ISBounds srcBounds,
                     FieldIDMapper mp)
Deprecated. 

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 the datasource and datums in the DataBlock. This argument can be null indicating that all fields are included.

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

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 DataSource attributes to be written into the DataBlock datums.

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

toString

public java.lang.String toString()
Description copied from class: CompositeDataSource
Print the data members of the DataSource in an easy to read fashion.

Overrides:
toString in class CompositeDataSource

subset

public DataSource subset(RecordDescriptor rd)

subset

public DataSource subset(ISBounds db)

subset

public DataSource subset(RecordDescriptor rd,
                         ISBounds db)

test1

public static void test1()
Tests AttributeJoinDataSource. Correctness test.


test2

public static void test2(java.lang.String[] argv)
Test AttributeJoinDataSource


main

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