#include <pathexpressionadornment.h>
Public Member Functions | |
PathExpressionAdornment (PathExpression *_path) | |
Constructor. | |
virtual | ~PathExpressionAdornment () |
void | print (OutputStream &dos) const |
Prints the object. | |
PathExpression * | getAdornedPath () |
Returns the adorned path. | |
PathExpression * | getRewrittenPath () |
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 | |
PathExpression * | adorned_path |
The associated adorned path. | |
PathExpression * | rewritten_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. |
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.
Definition at line 72 of file pathexpressionadornment.h.
PathExpressionAdornment::PathExpressionAdornment | ( | PathExpression * | _path | ) |
Constructor.
Constructor - creating object for a given PathExpression object.
[in] | _path | Pointer to the basing PathExpression object. |
Definition at line 37 of file pathexpressionadornment.cpp.
References PathExpression::addPathStep(), adorned_path, PathStepExpression::clone(), PathExpression::containsStarDescendantSequence(), PathStepExpression::getAxisType(), PathExpression::getPathSize(), PathExpression::getPathStepAt(), PathExpression::getPathSteps(), PathExpression::getTailPathStep(), is_child_node_path, is_child_text_path, is_descendant_node_path, is_descendant_text_path, is_dos_node_path, PathStepExpression::isDosNodeStep(), PathExpression::isEmptyPath(), PathStepExpression::isNodeNodeTest(), PathStepExpression::isStarNodeTest(), PathStepExpression::isTextNodeTest(), path_adornments, PathExpression::replacePathStepAt(), rewritten_path, PathExpression::selectsNoNode(), PathStepExpression::setAxisType(), TAG_SHADOW_FRONT, and TAG_SHADOW_TAIL.
PathExpressionAdornment::~PathExpressionAdornment | ( | ) | [virtual] |
Destructor.
Definition at line 198 of file pathexpressionadornment.cpp.
References adorned_path, and rewritten_path.
PathExpression * PathExpressionAdornment::getAdornedPath | ( | ) | [inline] |
Returns the adorned path.
The adorned path is set up in the constructor, computed from the basing path.
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.
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.
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.
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.
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.
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.
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.
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.
[in] | dos | Reference to the (debug) OutputStream. |
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.
PathExpression * PathExpressionAdornment::adorned_path [private] |
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().
bool PathExpressionAdornment::is_child_node_path [private] |
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().
bool PathExpressionAdornment::is_child_text_path [private] |
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().
bool PathExpressionAdornment::is_descendant_node_path [private] |
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().
bool PathExpressionAdornment::is_descendant_text_path [private] |
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().
bool PathExpressionAdornment::is_dos_node_path [private] |
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().