Patternist::Item Class Reference
[XQuery/XPath Data Model]

Represents an item in the XPath 2.0 Data Model. More...

#include <Item.h>

Inheritance diagram for Patternist::Item:

Inheritance graph
[legend]
Collaboration diagram for Patternist::Item:

Collaboration graph
[legend]
List of all members.

Public Types

typedef EmptyIterator< Item::PtrEmptyIterator
typedef Iterator< Item::PtrIterator
typedef QList< Item::PtrList
typedef ListIterator< Item::PtrListIterator
typedef PlainSharedPtr< ItemPtr
typedef SingletonIterator<
Item::Ptr
SingletonIterator
typedef QVector< Item::PtrVector

Public Member Functions

virtual bool isAtomicValue () const=0
 Determines whether this item is an atomic value, or a node.
virtual bool isNode () const=0
 Determines whether this item is an atomic value, or a node.
 Item ()
virtual QString stringValue () const=0
 Returns the string value of this Item.
virtual PlainSharedPtr< ItemTypetype () const=0
 Returns the ItemType this Item is of.
virtual Item::Iterator::Ptr typedValue () const=0
 Returns the typed value of this item.
virtual ~Item ()

Detailed Description

Represents an item in the XPath 2.0 Data Model.

There exists two types of items: nodes and atomic values.

The XQuery 1.0 and XPath 2.0 Data Model and XML Path Language (XPath) 2.0 specification makes a very strong distinction between a sequence of items and an atomized sequence.

Author:
Frans Englich <frans.englich@telia.com>

Definition at line 50 of file Item.h.


Member Typedef Documentation

typedef QList<Item::Ptr> Patternist::Item::List

A list of Item instances, each wrapped in a smart pointer.

Definition at line 64 of file Item.h.

typedef PlainSharedPtr<Item> Patternist::Item::Ptr

A smart pointer wrapping an Item instance.

Reimplemented in Patternist::AbstractDateTime, Patternist::AbstractDuration, Patternist::AnyURI, Patternist::AtomicValue, Patternist::Base64Binary, Patternist::Boolean, Patternist::Date, Patternist::DateTime, Patternist::DayTimeDuration, Patternist::Duration, Patternist::GDay, Patternist::GMonth, Patternist::GMonthDay, Patternist::GYear, Patternist::GYearMonth, Patternist::HexBinary, Patternist::Integer, Patternist::Node, Patternist::Numeric, Patternist::QNameValue, Patternist::String, Patternist::Time, Patternist::ValidationError, and Patternist::YearMonthDuration.

Definition at line 57 of file Item.h.

typedef QVector<Item::Ptr> Patternist::Item::Vector

A vector of Item instances, each wrapped in a smart pointer.

Definition at line 69 of file Item.h.


Constructor & Destructor Documentation

Patternist::Item::Item (  )  [inline]

Default constructor.

Definition at line 77 of file Item.h.

Item::~Item (  )  [virtual]

An ordinary destructor.

Definition at line 23 of file Item.cpp.


Member Function Documentation

virtual bool Patternist::Item::isAtomicValue (  )  const [pure virtual]

Determines whether this item is an atomic value, or a node.

See also:
isNode()
Returns:
true if it is an atomic value, otherwise false.

Implemented in Patternist::AtomicValue, and Patternist::Node.

virtual bool Patternist::Item::isNode (  )  const [pure virtual]

Determines whether this item is an atomic value, or a node.

This returns the opposite of isAtomicValue, and is provided for readability.

See also:
isAtomicValue()
Returns:
true if this item is a node, otherwise false.

Implemented in Patternist::AtomicValue, and Patternist::Node.

virtual QString Patternist::Item::stringValue (  )  const [pure virtual]

Returns the string value of this Item.

In the case of a node, it is the node value corresponding to the particular node type. For atomic values, it is equivalent to the value cast as xs:string.

Conceptually, this functions corresponds to the dm:string-value accessor.

See also:
XQuery 1.0 and XPath 2.0 Data Model, 5.13 string-value Accessor
Returns:
the string value.

Implemented in Patternist::AccelNode, Patternist::DelegateQDomNode, Patternist::AbstractFloat< isDouble >, Patternist::Base64Binary, Patternist::Boolean, Patternist::Date, Patternist::DateTime, Patternist::DayTimeDuration, Patternist::Decimal, Patternist::DerivedInteger< DerivedType >, Patternist::DerivedString< DerivedType >, Patternist::Duration, Patternist::GDay, Patternist::GMonth, Patternist::GMonthDay, Patternist::GYear, Patternist::GYearMonth, Patternist::HexBinary, Patternist::Integer, Patternist::QNameValue, Patternist::String, Patternist::Time, Patternist::ValidationError, and Patternist::YearMonthDuration.

virtual PlainSharedPtr<ItemType> Patternist::Item::type (  )  const [pure virtual]

Returns the ItemType this Item is of.

For example, if this Item is an XML node, more specifically a text node, text() is returned. That is, BuiltinTypes::text. However, if this Item is an atomic value of type xs:long that is what's returned, BuiltinTypes::xsLong.

Returns:
the type of this Item.

Implemented in Patternist::AccelNode, Patternist::DelegateQDomNode, Patternist::AbstractFloat< isDouble >, Patternist::AnyURI, Patternist::Base64Binary, Patternist::Boolean, Patternist::Date, Patternist::DateTime, Patternist::DayTimeDuration, Patternist::Decimal, Patternist::DerivedInteger< DerivedType >, Patternist::DerivedString< DerivedType >, Patternist::Duration, Patternist::GDay, Patternist::GMonth, Patternist::GMonthDay, Patternist::GYear, Patternist::GYearMonth, Patternist::HexBinary, Patternist::Integer, Patternist::QNameValue, Patternist::String, Patternist::Time, Patternist::UntypedAtomic, Patternist::ValidationError, and Patternist::YearMonthDuration.

Referenced by Patternist::AtomicValue::evaluateEBV().

Here is the caller graph for this function:

virtual Item::Iterator::Ptr Patternist::Item::typedValue (  )  const [pure virtual]

Returns the typed value of this item.

Conceptually, this functions corresponds to the dm:typed-value accessor. Here are examples of what the typed value of an Item is:

Returns:
the typed value of this item
See also:
XQuery 1.0 and XPath 2.0 Data Model, 5.15 typed-value Accessor

Implemented in Patternist::AccelNode, Patternist::DelegateQDomNode, and Patternist::AtomicValue.


The documentation for this class was generated from the following files:
Generated on Thu Feb 8 14:54:34 2007 for Patternist by  doxygen 1.5.1