edu.wpi.cs.dsrg.xmldb.xat.common.operator
Class XATOperatorImp

java.lang.Object
  |
  +--edu.wpi.cs.dsrg.xmldb.xat.common.operator.XATPropertiesImp
        |
        +--edu.wpi.cs.dsrg.xmldb.xat.common.operator.XATQueryObjectImp
              |
              +--edu.wpi.cs.dsrg.xmldb.xat.common.operator.XATOperatorImp
Direct Known Subclasses:
AggregateImp, ColumnNameListImp, ComposerImp, DistinctImp, ExposeImp, FunctionImp, NameColumnImp, NavigateImp, SelectImp, SourceImp, SQLStmtImp, TaggerImp, UpdateOperatorImp, XATMultiSourceOperatorImp, XQueryStmtImp

public abstract class XATOperatorImp
extends XATQueryObjectImp
implements XATOperator, java.io.Serializable

Implementation for interface XATOperator.

Since:
1.0
See Also:
Serialized Form

Field Summary
protected  int columnsFiltered
           
protected  java.lang.String outputColumnName
           
protected  XATNode xnodOwner
           
protected  XATDataSource xtabOutput
           
 
Fields inherited from class edu.wpi.cs.dsrg.xmldb.xat.common.operator.XATQueryObjectImp
stats, statsPresent
 
Constructor Summary
XATOperatorImp(XATNode node)
          Assign a node to this operator .
 
Method Summary
 java.lang.Object clone()
          Clones the XATOperator.
 int getColumnsFiltered()
          Gets column filtersd.
 XATNode getNode()
          Gets the node.
 XATTable getOutput()
          Deprecated. use XATOperator.getOutputDataSource, then cast to a table or a queue
 java.lang.String getOutputColumnName()
          Gets output column name.
 XATDataSource getOutputDataSource()
          Get the output of this Operator.
 java.util.Iterator getOutputDataSources()
          Get all output data sources for this XATOperator
 XATDataSource getPrimaryDataSource()
          Get primary data source.
 XATTable getPrimarySource()
          Deprecated. use XATOperator.getPrimaryDataSource, then cast to a table or a queue
protected  void setDefaultProperties()
          This will set the default properties that all XATOperators will have.
 void setNode(XATNode node)
          Sets the opertor's node.
 void setOutput(XATDataSource output)
          Sets the ouput data source.
 void setOutputColumnName(java.lang.String OutputColumnName)
          Sets output columns.
 void setProperty(java.lang.String name, java.lang.String value)
          sets the given property to the new value.
 java.lang.String toString()
          returns a string representation
 
Methods inherited from class edu.wpi.cs.dsrg.xmldb.xat.common.operator.XATQueryObjectImp
addStatistic, compareTo, getStatistics, isValidStatistic, setDefaultStatistics
 
Methods inherited from class edu.wpi.cs.dsrg.xmldb.xat.common.operator.XATPropertiesImp
addProperty, getProperties, getProperty, isValidPropertyName, setNewPropertyValue
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

xnodOwner

protected XATNode xnodOwner

xtabOutput

protected XATDataSource xtabOutput

outputColumnName

protected java.lang.String outputColumnName

columnsFiltered

protected int columnsFiltered
Constructor Detail

XATOperatorImp

public XATOperatorImp(XATNode node)
Assign a node to this operator .
Parameters:
node - edu.wpi.cs.dsrg.xmldb.xat.common.xatnode.XATNode
Since:
1.0
Method Detail

clone

public java.lang.Object clone()
Clones the XATOperator.
Specified by:
clone in interface XATOperator
Overrides:
clone in class java.lang.Object
Since:
1.0

getColumnsFiltered

public int getColumnsFiltered()
Gets column filtersd.
Returns:
columnsFiltered.
Since:
1.0

getNode

public XATNode getNode()
Gets the node.
Specified by:
getNode in interface XATOperator
Returns:
xnodOwner.
Since:
1.0

getOutput

public XATTable getOutput()
Deprecated. use XATOperator.getOutputDataSource, then cast to a table or a queue

Gets the output of this Operator.
Specified by:
getOutput in interface XATOperator
Returns:
the output XATTable of this operator.
Since:
1.0

getOutputColumnName

public java.lang.String getOutputColumnName()
Gets output column name.
Specified by:
getOutputColumnName in interface XATOperator
Returns:
output column name
Since:
1.0

getOutputDataSource

public XATDataSource getOutputDataSource()
Get the output of this Operator.
Specified by:
getOutputDataSource in interface XATOperator
Returns:
the output DataSource of this operator.
Since:
1.0

getOutputDataSources

public java.util.Iterator getOutputDataSources()
Get all output data sources for this XATOperator
Specified by:
getOutputDataSources in interface XATOperator
Returns:
Iterator of data sources.
Since:
1.0

getPrimaryDataSource

public XATDataSource getPrimaryDataSource()
                                   throws XATNodeDoesNotExistException
Get primary data source. The primary data source will be the first data source in all the operators. For example: For all the Join the primary data source is source l. For all the Union operators is the first source. For CO is the source S1.
Specified by:
getPrimaryDataSource in interface XATOperator
Returns:
XATDataSource of the primary data source.
Throws:
XATNodeDoesNotExistException -  
Since:
1.0

getPrimarySource

public XATTable getPrimarySource()
                          throws XATNodeDoesNotExistException
Deprecated. use XATOperator.getPrimaryDataSource, then cast to a table or a queue

Get primary data source. The primary data source will be the first data source in all the operators. For example: For all the Join the primary data source is source l. For all the Union operators is the first source. For CO is the source S1.
Specified by:
getPrimarySource in interface XATOperator
Returns:
XATTable of the primary data source.
Throws:
XATNodeDoesNotExistException -  
Since:
1.0

setDefaultProperties

protected void setDefaultProperties()
This will set the default properties that all XATOperators will have.
Overrides:
setDefaultProperties in class XATQueryObjectImp
Since:
1.0

setNode

public void setNode(XATNode node)
Sets the opertor's node.
Specified by:
setNode in interface XATOperator
Parameters:
newNode - edu.wpi.cs.dsrg.xmldb.xat.common.xatnode.XATNode
Since:
1.0

setOutput

public void setOutput(XATDataSource output)
Sets the ouput data source.
Specified by:
setOutput in interface XATOperator
Parameters:
newoutput - output data source
Since:
1.0

setOutputColumnName

public void setOutputColumnName(java.lang.String OutputColumnName)
Sets output columns.
Specified by:
setOutputColumnName in interface XATOperator
Parameters:
OutputColumnName - java.lang.String
Since:
1.0

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
                 throws java.lang.Exception
sets the given property to the new value. This method is responsible for validating the given property. An exception is thrown if the value is not correct. Validation should be done in the following manner: First the method should check if the object supports the given property by calling isValidPropertyName(String). If it is not a valid property name, then an exception should be thrown.

Once it is known that the object supports the property, the value must be validated. Each implementor of XATStatistics has a set of properties that are common to all of its types and some that are specific to types. For example, all XATOperators (which implement XATStatistics) have certain properties while an individual XATOperator has specific properties. The indivual types should only validate their own specific types. If the caller is trying to set a common type, it should be validated by the super class by calling super.setProperty(name, value). This will reduce duplicate code.

When it is determined the name / value pair is correct, the pair is updated using setNewPropertyValue()

XATStatisticsImp provides default validation by checking to see if the property's value is >=0. propertyValues that are Strings will just be set. If the property requires more strict constraints than this, it is up to the subclass that created the property to validate it (as described above).

Overrides:
setProperty in class XATPropertiesImp
Parameters:
name - the name of the property to set
value - the new value of the property
name - the name of the property to set
value - the new value of the property
Throws:
java.lang.Exception - if the given property cannot be found or if the value is not valid for the given property.
java.lang.Exception - if the given property cannot be found or if the value is not valid for the given property.
Since:
1.0

toString

public java.lang.String toString()
returns a string representation
Overrides:
toString in class java.lang.Object
Returns:
java.lang.String
Since:
1.0