PathExpressionAdornment Class Reference

An adorned path expression. More...

#include <pathexpressionadornment.h>

Collaboration diagram for PathExpressionAdornment:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 PathExpressionAdornment (PathExpression *_path)
 Constructor.
virtual ~PathExpressionAdornment ()
void print (OutputStream &dos) const
 Prints the object.
PathExpressiongetAdornedPath ()
 Returns the adorned path.
PathExpressiongetRewrittenPath ()
 Returns the rewritten path.
vector< unsigned > * getPathAdornments ()
 Returns a pointer to the path adornments associated with member adorned_path.
bool isChildNodePath ()
 Checks if the original path ends with a child::node() path step.
bool isDescendantNodePath ()
 Checks if the original path ends with a descendant::node() path step.
bool isDosNodePath ()
 Checks if the original path ends with a dos::node() path step.
bool isChildTextPath ()
 Checks if the original path ends with a child::text() path step.
bool isDescendantTextPath ()
 Checks if the original path ends with a descendant::text() path step.

Private Attributes

PathExpressionadorned_path
 The associated adorned path.
PathExpressionrewritten_path
 An intermediate data structure that accounts for special path steps not covered in the original work by Miklau and Suciu cited in the class description.
vector< unsigned > path_adornments
 The path adornments associated with member adorned_path.
bool is_child_node_path
 True if the original path ends with child::node path step.
bool is_descendant_node_path
 True if the original path ends with a descendant::node() path step.
bool is_dos_node_path
 True if the original path ends with a dos::node() path step.
bool is_child_text_path
 True if the original path ends with a child::text() path step.
bool is_descendant_text_path
 True if the original path ends with a descendant::text() path step.


Detailed Description

An adorned path expression.

More information on XPath containment and path expression adornments can be found in G. Miklau, D. Suciu: Containment and Equivalence of a Fragment of XPath, in Journal of the ACM, vol. 51, no. 1, 2004. Note that the fragment covered here slightly differs from the fragment covered in the before-mentioned publication, so some adjustments and special treatment was necessary (e.g. for node() and text() node tests). In summary, we implement a sound (but not necessarily) complete algorithm for checking XPath containment. The XPath containment check is used for optimization purpose only, so the incompleteness does not harm the correctness of the implementation.

Author:
Michael Schmidt

Gunnar Jehl

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

Definition at line 72 of file pathexpressionadornment.h.


Constructor & Destructor Documentation

PathExpressionAdornment::PathExpressionAdornment ( PathExpression _path  ) 

PathExpressionAdornment::~PathExpressionAdornment (  )  [virtual]

Destructor.

Definition at line 198 of file pathexpressionadornment.cpp.

References adorned_path, and rewritten_path.


Member Function Documentation

PathExpression * PathExpressionAdornment::getAdornedPath (  )  [inline]

Returns the adorned path.

The adorned path is set up in the constructor, computed from the basing path.

Return values:
PathExpression* The adorned PathExpression represented by this object.

Definition at line 100 of file pathexpressionadornment.h.

References adorned_path.

Referenced by PathExpression::isSemanticallyContainedIn().

vector< unsigned > * PathExpressionAdornment::getPathAdornments (  )  [inline]

Returns a pointer to the path adornments associated with member adorned_path.

See the work of Miklau and Suciu cited in the class description for details on path adornments.

Return values:
vector<unsigned>* Pointer to the path adornments vector.

Definition at line 120 of file pathexpressionadornment.h.

References path_adornments.

Referenced by PathExpression::isSemanticallyContainedIn().

PathExpression * PathExpressionAdornment::getRewrittenPath (  )  [inline]

Returns the rewritten path.

The rewritten path is an intermediate data structure, which represents a rewritten version of the basng path where, for instance, special path steps such as dos::node() are transformed or eliminated.

Return values:
PathExpression* The rewritten path.

Definition at line 109 of file pathexpressionadornment.h.

Referenced by PathExpression::isSemanticallyContainedIn().

bool PathExpressionAdornment::isChildNodePath (  )  [inline]

Checks if the original path ends with a child::node() path step.

Accounts for special features not covered in the original work of Miklau and Suciu cited in the class description.

Return values:
bool True if the original path ends with a child::node() path step, false otherwise.

Definition at line 131 of file pathexpressionadornment.h.

References is_child_node_path.

Referenced by PathExpression::isSemanticallyContainedIn().

bool PathExpressionAdornment::isChildTextPath (  )  [inline]

Checks if the original path ends with a child::text() path step.

Accounts for special features not covered in the original work by Miklau and Suciu cited in the class description.

Return values:
bool True if the original path ends with a child::text() path step, false otherwise.

Definition at line 164 of file pathexpressionadornment.h.

References is_child_text_path.

Referenced by PathExpression::isSemanticallyContainedIn().

bool PathExpressionAdornment::isDescendantNodePath (  )  [inline]

Checks if the original path ends with a descendant::node() path step.

Accounts for special features not covered in the original work by Miklau and Suciu cited in the class description.

Return values:
bool True if the original path ends with a descendant::node() path step, false otherwise.

Definition at line 142 of file pathexpressionadornment.h.

References is_descendant_node_path.

Referenced by PathExpression::isSemanticallyContainedIn().

bool PathExpressionAdornment::isDescendantTextPath (  )  [inline]

Checks if the original path ends with a descendant::text() path step.

Accounts for special features not covered in the original work by Miklau and Suciu cited in the class description.

Return values:
bool True if the original path ends with a descendant::text() path step, false otherwise.

Definition at line 175 of file pathexpressionadornment.h.

References is_descendant_text_path.

Referenced by PathExpression::isSemanticallyContainedIn().

bool PathExpressionAdornment::isDosNodePath (  )  [inline]

Checks if the original path ends with a dos::node() path step.

Accounts for special features not covered in the original work by Miklau and Suciu cited in the class description.

Return values:
bool True if the original path ends with a dos::node() path step, false otherwise.

Definition at line 153 of file pathexpressionadornment.h.

References is_dos_node_path.

Referenced by PathExpression::isSemanticallyContainedIn().

void PathExpressionAdornment::print ( OutputStream dos  )  const

Prints the object.

Used for debugging purpose only.

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

Definition at line 203 of file pathexpressionadornment.cpp.

References adorned_path, PathExpression::getPathSize(), is_child_node_path, is_child_text_path, is_descendant_node_path, is_descendant_text_path, is_dos_node_path, and path_adornments.


Member Data Documentation

The associated adorned path.

This member is calculated from the original path in the class constructor. The associated adornment information is stored in member path_adornments.

Definition at line 186 of file pathexpressionadornment.h.

Referenced by getAdornedPath(), PathExpressionAdornment(), print(), and ~PathExpressionAdornment().

True if the original path ends with child::node path step.

Accounts for special features not covered in the original work by Miklau and Suciu cited in the class description.

Definition at line 210 of file pathexpressionadornment.h.

Referenced by isChildNodePath(), PathExpressionAdornment(), and print().

True if the original path ends with a child::text() path step.

Accounts for special features not covered in the original work by Miklau and Suciu cited in the class description.

Definition at line 231 of file pathexpressionadornment.h.

Referenced by isChildTextPath(), PathExpressionAdornment(), and print().

True if the original path ends with a descendant::node() path step.

Accounts for special features not covered in the original work by Miklau and Suciu cited in the path description.

Definition at line 217 of file pathexpressionadornment.h.

Referenced by isDescendantNodePath(), PathExpressionAdornment(), and print().

True if the original path ends with a descendant::text() path step.

Accounts for special features not covered in the original work by Miklau and Suciu cited in the class description.

Definition at line 238 of file pathexpressionadornment.h.

Referenced by isDescendantTextPath(), PathExpressionAdornment(), and print().

True if the original path ends with a dos::node() path step.

Accounts for special features not covered in the original work by Miklau and Suciu cited in the class description.

Definition at line 224 of file pathexpressionadornment.h.

Referenced by isDosNodePath(), PathExpressionAdornment(), and print().

vector< unsigned > PathExpressionAdornment::path_adornments [private]

The path adornments associated with member adorned_path.

See the work of Miklau and Suciu cited in the class description for details on path adornments.

Definition at line 203 of file pathexpressionadornment.h.

Referenced by getPathAdornments(), PathExpressionAdornment(), and print().

An intermediate data structure that accounts for special path steps not covered in the original work by Miklau and Suciu cited in the class description.

The rewritten path is an intermediate data structure, which represents a rewritten version of the basng path where, for instance, special path steps such as dos::node() are transformed or eliminated.

Definition at line 196 of file pathexpressionadornment.h.

Referenced by PathExpressionAdornment(), and ~PathExpressionAdornment().


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