edu.unh.sdb.datasource
Class DataSourceBuilder

java.lang.Object
  extended by edu.unh.sdb.datasource.DataSourceBuilder
Direct Known Subclasses:
AJDataSourceBuilder, BlockedDataSourceBuilder, VRDataSourceBuilder

public abstract class DataSourceBuilder
extends java.lang.Object

Manufactures Logical DataSource objects such AttributeJoin and Blocked DataSources. Hold relevant data and validates before instantiating the appropriate DataSource objects


Field Summary
protected  java.util.Vector componentBounds
          the bounds for each component
protected  java.util.Vector componentFieldPositions
          the component field positions for mapping from component to composite
protected  java.util.Vector componentIndices
          the designated component Datasource indices into DataSourceList
protected  java.util.Vector componentMaps
           
protected  ISBounds compositeBounds
          denotes extent of Index Space for the pending datasource
protected  java.util.Vector compositeFieldNames
          rdb added a single composite name vector; could have holes in it
protected  java.util.Vector compositeFieldPositions
          the composite field positions for mapping from component to composite
protected  boolean discardFlag
          datasource is not to be instantiated
protected  DataSourceCollection dsList
          table/list to hold the available datasources
protected  java.util.Vector nameMapping
          the composite field names for mapping from component to composite
 
Constructor Summary
DataSourceBuilder(DataSourceCollection d, java.lang.String n)
          Default Constructor
 
Method Summary
 boolean addComponent(java.lang.String s)
          adds DataSource named by the String to the list of components with the bounds implied to be that of the datasource named by the String.
 boolean addComponent(java.lang.String s, ISBounds b)
          adds DataSource named by the String to the list of components with the bounds specified.
protected  ISBounds[] getAllComponentBounds()
          Returns an array containing the bounds of the Index Space for each component of the pending datasource.
protected  DataSource[] getComponentDataSources()
          Returns an array containing the component datasources.
protected  int getComponentFieldPosition(java.lang.String name)
          Examines the current component datasource and returns the position of the field named by "name".
 ISBounds getCompositeBounds()
          Returns the bounds of the Index Space for the pending datasource.
protected  DataSource getCurrentDataSource()
          Returns the DataSource object mapped to the most recent compoent
 FDLDescriptor getCurrentFDLDescriptor()
          Returns the current File Descriptor Language object
 java.lang.String getDSName()
          Returns the datasource name
protected  DataSource getFirstComponentDataSource()
          Returns the first DataSource in the component list or a null if no components have been specified.
static void main(java.lang.String[] args)
           
 ISBounds makeComponentBounds()
          Converts upper and lower axes arrays into an ISBounds object
protected  FieldIDMapper makeComponentFieldIDMapper()
          returns a FieldIDMapper for the current component
protected  ComponentInfo[] makeComponentInfos()
          instantiate a list of ComponentInfos to be used to create the datasource
 DataSource makeDataSource()
          instantiates an actual datasource
protected  ISIDMapper makeISIDMapper(int i)
          returns an ISIDMapper for a component
 void processFinalComponentMap()
          completes a new FieldIDMapper for current component
 void setComponentAxes(java.lang.Integer l, java.lang.Integer u)
          adds an upper and lower axes to an individual component bounds specification
 void setComponentFieldPair(java.lang.String name, java.lang.Integer compositePosition)
          Store fieldname/position pairs for the component attributes.
 void setComponentFieldPair(java.lang.String name, java.lang.Integer compositePosition, java.lang.String compositeName)
          store fieldname/position pairs for the component attributes
 void setCompositeBounds(ISBounds bounds)
          Sets the bounds of the Index Space for the pending datasource
 void setCurrentFDLDescriptor(FDLDescriptor fdl)
          Sets the current File Descriptor Language object
 void setDSName(java.lang.String s)
          Sets the datasource name to the String provided
 java.lang.String toString()
          diagnostic utility method for dumping this class to a string
protected static int[] vectorToIntArray(java.util.Vector v)
          makes an integer array out of a vector
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dsList

protected DataSourceCollection dsList
table/list to hold the available datasources


componentIndices

protected java.util.Vector componentIndices
the designated component Datasource indices into DataSourceList


componentBounds

protected java.util.Vector componentBounds
the bounds for each component


compositeBounds

protected ISBounds compositeBounds
denotes extent of Index Space for the pending datasource


discardFlag

protected boolean discardFlag
datasource is not to be instantiated


componentMaps

protected java.util.Vector componentMaps

componentFieldPositions

protected java.util.Vector componentFieldPositions
the component field positions for mapping from component to composite


compositeFieldPositions

protected java.util.Vector compositeFieldPositions
the composite field positions for mapping from component to composite


nameMapping

protected java.util.Vector nameMapping
the composite field names for mapping from component to composite


compositeFieldNames

protected java.util.Vector compositeFieldNames
rdb added a single composite name vector; could have holes in it

Constructor Detail

DataSourceBuilder

public DataSourceBuilder(DataSourceCollection d,
                         java.lang.String n)
Default Constructor

Method Detail

setDSName

public void setDSName(java.lang.String s)
Sets the datasource name to the String provided


getDSName

public java.lang.String getDSName()
Returns the datasource name


setCurrentFDLDescriptor

public void setCurrentFDLDescriptor(FDLDescriptor fdl)
Sets the current File Descriptor Language object


getCurrentFDLDescriptor

public FDLDescriptor getCurrentFDLDescriptor()
Returns the current File Descriptor Language object


getCurrentDataSource

protected DataSource getCurrentDataSource()
Returns the DataSource object mapped to the most recent compoent


setCompositeBounds

public void setCompositeBounds(ISBounds bounds)
Sets the bounds of the Index Space for the pending datasource


getCompositeBounds

public ISBounds getCompositeBounds()
Returns the bounds of the Index Space for the pending datasource. If no bounds were specified, the bounds of the first component datasource will be returned.


getAllComponentBounds

protected ISBounds[] getAllComponentBounds()
Returns an array containing the bounds of the Index Space for each component of the pending datasource.


getComponentDataSources

protected DataSource[] getComponentDataSources()
Returns an array containing the component datasources.


getFirstComponentDataSource

protected DataSource getFirstComponentDataSource()
Returns the first DataSource in the component list or a null if no components have been specified.


makeComponentBounds

public ISBounds makeComponentBounds()
Converts upper and lower axes arrays into an ISBounds object


vectorToIntArray

protected static int[] vectorToIntArray(java.util.Vector v)
makes an integer array out of a vector


setComponentAxes

public void setComponentAxes(java.lang.Integer l,
                             java.lang.Integer u)
adds an upper and lower axes to an individual component bounds specification


makeISIDMapper

protected ISIDMapper makeISIDMapper(int i)
returns an ISIDMapper for a component


addComponent

public boolean addComponent(java.lang.String s)
adds DataSource named by the String to the list of components with the bounds implied to be that of the datasource named by the String.


addComponent

public boolean addComponent(java.lang.String s,
                            ISBounds b)
adds DataSource named by the String to the list of components with the bounds specified.


processFinalComponentMap

public void processFinalComponentMap()
completes a new FieldIDMapper for current component


setComponentFieldPair

public void setComponentFieldPair(java.lang.String name,
                                  java.lang.Integer compositePosition,
                                  java.lang.String compositeName)
store fieldname/position pairs for the component attributes


setComponentFieldPair

public void setComponentFieldPair(java.lang.String name,
                                  java.lang.Integer compositePosition)
Store fieldname/position pairs for the component attributes. New name is defaulted to be the same as the original name.


getComponentFieldPosition

protected int getComponentFieldPosition(java.lang.String name)
Examines the current component datasource and returns the position of the field named by "name". If field name does not exist -1 will be returned


makeComponentFieldIDMapper

protected FieldIDMapper makeComponentFieldIDMapper()
returns a FieldIDMapper for the current component


makeComponentInfos

protected ComponentInfo[] makeComponentInfos()
instantiate a list of ComponentInfos to be used to create the datasource


makeDataSource

public DataSource makeDataSource()
instantiates an actual datasource


toString

public java.lang.String toString()
diagnostic utility method for dumping this class to a string

Overrides:
toString in class java.lang.Object

main

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