|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.medor.lib.BasicTupleStructure | +--org.objectweb.medor.query.lib.BasicQueryTree | +--org.objectweb.medor.query.lib.BasicQueryNode
A BasicQueryNode is an implementation of QueryNode. It also implements QueryIndexGenerator and RWTupleStructure (it is its own TupleStructure).
Field Summary | |
protected java.util.List |
children
|
protected Expression |
filter
|
protected int[] |
indexes
Contains ranges of attribute to be projected from the tuple resulting of the concatenation of the tuples from the children QueryTrees. |
protected TupleLoader |
tupleLoader
|
Fields inherited from class org.objectweb.medor.query.lib.BasicQueryTree |
debug, distinct, log, name, orderfields |
Fields inherited from class org.objectweb.medor.lib.BasicTupleStructure |
fields, name2field |
Constructor Summary | |
BasicQueryNode(java.lang.String _name,
OptimizationMetaData optimizationMD)
|
Method Summary | |
CalculatedField |
addCalculatedField(java.lang.String name,
PType type,
Expression exp)
Creates and adds a CalculatedField to the TupleStructure of the QueryNode. |
protected void |
addChild(QueryTree qt)
|
protected void |
addField(Field f)
Adds a Field to the current RWTupleStructure |
PropagatedField |
addPropagatedField(java.lang.String name,
PType type,
QueryTreeField[] anc)
Creates and adds a PropagatedField to the TupleStructure of the QueryNode. |
java.lang.Object |
clone()
|
QueryTree[] |
getChildren()
It retreives the array of the QueryTree used by this QueryNode. |
boolean |
getDistinct()
Tests whether the results should be distinct or not. |
protected java.lang.String |
getFieldName(java.lang.String nodeName,
java.lang.String fieldName)
|
java.lang.String |
getName()
It returns the name of the query tree. |
OptimizationMetaData |
getOptimizationMetaData()
It retrieves the meta information about the optimization. |
Expression |
getQueryFilter()
Retrieves the filter associated to the QueryTree. |
TupleLoader |
getTupleLoader()
Returns the TupleLoader currently associated with this QueryNode. |
TupleStructure |
getTupleStructure()
Returns the TupleStructure associated to the QueryTree. |
abstract short |
getType()
It retrieves the operation type of the current QueryNode. |
QueryTreeField |
removeField(java.lang.String name)
Removes a Field. |
QueryTreeField |
replace(QueryTreeField old,
QueryTreeField neo)
|
void |
setDistinct(boolean distinct)
Indicates whether evaluating the QueryTree should return unique results (duplicate elimination) or not. |
void |
setQueryFilter(Expression filter)
The setQueryFilter method will be overwritten for implementations which do not support the operation. |
void |
setTupleLoader(TupleLoader loader)
Associates a TupleLoader with this QueryNode. |
void |
updateCalculatedField(java.lang.String name,
Expression e)
|
protected void |
updateChildren()
Updates the list of children by screening all Fields and the query filter. |
void |
updatePropagatedField(java.lang.String name,
QueryTreeField[] previous)
|
Methods inherited from class org.objectweb.medor.query.lib.BasicQueryTree |
getOrderBy, setOrderBy |
Methods inherited from class org.objectweb.medor.lib.BasicTupleStructure |
contains, contains, getField, getField, getFieldRank, getFields, getSize |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.objectweb.medor.query.api.QueryTree |
getOrderBy, setOrderBy |
Field Detail |
protected java.util.List children
protected TupleLoader tupleLoader
protected Expression filter
protected int[] indexes
Constructor Detail |
public BasicQueryNode(java.lang.String _name, OptimizationMetaData optimizationMD)
Method Detail |
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface Cloneable
clone
in class BasicQueryTree
java.lang.CloneNotSupportedException
public java.lang.String getName()
QueryTree
getName
in interface QueryTree
getName
in class BasicQueryTree
public PropagatedField addPropagatedField(java.lang.String name, PType type, QueryTreeField[] anc) throws MedorException
addPropagatedField
in interface QueryNode
name
- is the name of the Field to be added.type
- is the PType of the Field to be added.anc
- are the origin Fields for the PropagatedField to be created.
MedorException
- when a Field with the same name already exists.public CalculatedField addCalculatedField(java.lang.String name, PType type, Expression exp) throws MedorException
addCalculatedField
in interface QueryNode
name
- is the name of the Field to be added.type
- is the PType of the Field to be added.exp
- is the Expression for calculating the new Field.
MedorException
- when a Field with the same name already exists.public QueryTreeField removeField(java.lang.String name) throws MedorException
removeField
in interface QueryNode
name
- is the name of the Field to be removed.
MedorException
- when no Field with such name exist.public QueryTree[] getChildren()
QueryNode
getChildren
in interface QueryNode
public QueryTreeField replace(QueryTreeField old, QueryTreeField neo)
replace
in interface QueryNode
public OptimizationMetaData getOptimizationMetaData()
QueryNode
getOptimizationMetaData
in interface QueryNode
public void setQueryFilter(Expression filter) throws java.lang.UnsupportedOperationException
setQueryFilter
in interface FilteredQueryTree
filter
- is the Expression representing the query filter of the current
QueryNode.
java.lang.UnsupportedOperationException
- when it is not supported
(for Union, Intersection, Cartesian, Projection).Expression
public Expression getQueryFilter()
FilteredQueryTree
getQueryFilter
in interface FilteredQueryTree
Expression
public abstract short getType()
QueryNode
getType
in interface QueryNode
public TupleStructure getTupleStructure()
QueryTree
getTupleStructure
in interface QueryTree
getTupleStructure
in class BasicQueryTree
public TupleLoader getTupleLoader()
QueryNode
getTupleLoader
in interface QueryNode
public void setTupleLoader(TupleLoader loader)
QueryNode
setTupleLoader
in interface QueryNode
public void updatePropagatedField(java.lang.String name, QueryTreeField[] previous) throws MedorException
updatePropagatedField
in interface QueryNode
MedorException
public void updateCalculatedField(java.lang.String name, Expression e) throws MedorException
updateCalculatedField
in interface QueryNode
MedorException
public void setDistinct(boolean distinct)
QueryTree
The default should be that duplicates are not eliminated (distinct is false).
setDistinct
in interface QueryTree
setDistinct
in class BasicQueryTree
distinct
- is true if duplicates should be eliminated, false
otherwise.public boolean getDistinct()
QueryTree
getDistinct
in interface QueryTree
getDistinct
in class BasicQueryTree
protected void addField(Field f)
f
- The Field to be added.protected void updateChildren()
protected java.lang.String getFieldName(java.lang.String nodeName, java.lang.String fieldName)
protected void addChild(QueryTree qt)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |