ProjectionTreeLabels Class Reference

Calculates and stores the set of all projection tree labels. More...

#include <projectiontreelabels.h>

Collaboration diagram for ProjectionTreeLabels:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ProjectionTreeLabels (ProjectionTreeNode *root)
 Constructor.
virtual ~ProjectionTreeLabels ()
void updateParentPredecessorInformation ()
 Brings the parent and predecessor links of the labels up to date.
void print (OutputStream &dos)
 Prints all projection tree labels.
void getAllRecursiveDosNodeSuccessors (unsigned id, vector< unsigned > &succ)
 Returns the ids of all dos::node() successors recursively.
ProjectionTreeLabelgetLabelById (unsigned id)
 Returns the label by ID.
unsigned nrOfLabels ()
 Returns the number of all projection tree labels.

Private Member Functions

ProjectionTreeLabelcomputeProjectionTreeLabels (ProjectionTreeNode *n, unsigned &id, unsigned cur_position)
 Help function for projection tree label computation.

Private Attributes

vector< ProjectionTreeLabel * > labels


Detailed Description

Calculates and stores the set of all projection tree labels.

Represents a dictionary that contains all ProjectionTreeLabel objects that have been extracted from the ProjectionTree.

Author:
Michael Schmidt

Gunnar Jehl

Version:
2.1
License:
Software License Agreement (BSD License)

Definition at line 50 of file projectiontreelabels.h.


Constructor & Destructor Documentation

ProjectionTreeLabels::ProjectionTreeLabels ( ProjectionTreeNode root  ) 

Constructor.

Constructor - creating object for a ProjectionTreeNode.

Parameters:
[in] root Pointer to a ProjectionTreeNode object.

Definition at line 37 of file projectiontreelabels.cpp.

References computeProjectionTreeLabels().

ProjectionTreeLabels::~ProjectionTreeLabels (  )  [virtual]

Destructor.

Definition at line 43 of file projectiontreelabels.cpp.

References labels.


Member Function Documentation

ProjectionTreeLabel * ProjectionTreeLabels::computeProjectionTreeLabels ( ProjectionTreeNode n,
unsigned &  id,
unsigned  cur_position 
) [private]

Help function for projection tree label computation.

Recursively calls itself.

Parameters:
[in] n The parent node.
[in] id The id of the parent node.
[in] cur_position The current path step position in the current path.
Return values:
ProjectionTreeLabel* The label that has been set up.

Definition at line 83 of file projectiontreelabels.cpp.

References ProjectionTreeNode::getChildren(), ProjectionTreeLabel::getChildSuccessors(), ProjectionTreeNode::getPath(), PathExpression::getPathSize(), ProjectionTreeLabel::getProjectionTreeNode(), ProjectionTreeLabel::getSelfSuccessors(), and labels.

Referenced by ProjectionTreeLabels().

void ProjectionTreeLabels::getAllRecursiveDosNodeSuccessors ( unsigned  id,
vector< unsigned > &  succ 
)

Returns the ids of all dos::node() successors recursively.

Ignores all successors without dos::node() label; for suchlike successors, no further recursion is performed.

Parameters:
[in] id The id of the token we search the dos::node() successors for.
[in] succ Collects the ids of all dos::node() successors.
Return values:
void 

Definition at line 59 of file projectiontreelabels.cpp.

References ProjectionTreeLabel::getChildSuccessors(), ProjectionTreeLabel::getId(), getLabelById(), ProjectionTreeLabel::getSameLevelSuccessor(), and ProjectionTreeLabel::isDosNodeLabel().

Referenced by TokenConfiguration::TokenConfiguration().

ProjectionTreeLabel * ProjectionTreeLabels::getLabelById ( unsigned  id  )  [inline]

Returns the label by ID.

Implements a straightforward dictionary lookup.

Parameters:
[in] id The ID of the label that is requested.
Return values:
ProjectionTreeLabel* Pointer to the ProjectionTreeLabel with the specified ID.

Definition at line 97 of file projectiontreelabels.h.

References labels.

Referenced by TokenConfiguration::applyTag(), TokenConfiguration::applyText(), TokenConfiguration::createRoleList(), TokenConfiguration::forceChildKeep(), getAllRecursiveDosNodeSuccessors(), TokenConfiguration::isOutput(), and TokenConfiguration::keepSubtree().

unsigned ProjectionTreeLabels::nrOfLabels (  )  [inline]

Returns the number of all projection tree labels.

Returns the number of all projection tree labels.

Return values:
unsigned The number of projection tree labels.

Definition at line 104 of file projectiontreelabels.h.

Referenced by TokenConfiguration::TokenConfiguration().

void ProjectionTreeLabels::print ( OutputStream dos  ) 

Prints all projection tree labels.

Used for debugging purpose only.

Parameters:
[in] dos Reference to the (debug) OutputStream.
Return values:
void 

Definition at line 53 of file projectiontreelabels.cpp.

References labels.

Referenced by Executor::buildProjectionTree().

void ProjectionTreeLabels::updateParentPredecessorInformation (  ) 

Brings the parent and predecessor links of the labels up to date.

To be called once after extraction.

Return values:
void 

Definition at line 49 of file projectiontreelabels.cpp.

References labels.

Referenced by ProjectionTree::labelTree().


Member Data Documentation

Stores the list of all projection tree labels.

Definition at line 125 of file projectiontreelabels.h.

Referenced by computeProjectionTreeLabels(), getLabelById(), print(), updateParentPredecessorInformation(), and ~ProjectionTreeLabels().


Generated on Sun May 24 20:20:28 2009 for G(arbage) C(ollected) X(Query) Engine by  doxygen 1.5.9