SaxonC 12.5
Saxon Processor library for C/C++, PHP and Python
Loading...
Searching...
No Matches
Public Member Functions | List of all members
XdmAtomicValue Class Reference

#include <XdmAtomicValue.h>

Inheritance diagram for XdmAtomicValue:
XdmItem XdmValue

Public Member Functions

 XdmAtomicValue ()
 A default Constructor.
 
 XdmAtomicValue (const XdmAtomicValue &other)
 A copy constructor.
 
virtual ~XdmAtomicValue ()
 Destructor.
 
 XdmAtomicValue (int64_t val)
 A Java Wrapper Constructor.
 
 XdmAtomicValue (int64_t val, const char *ty)
 A Java Wrapper Constructor.
 
const char * getPrimitiveTypeName ()
 Get the primitive type of this atomic value, as a QName.
 
bool getBooleanValue ()
 Get the value converted to a boolean using the XPath casting rules.
 
double getDoubleValue ()
 Get the value converted to a double using the XPath casting rules.
 
const char * getStringValue ()
 Get the string value of the item.
 
long getLongValue ()
 Get the value converted to an integer using the XPath casting rules.
 
void setType (const char *ty)
 Set the type annotation of the atomic value.
 
XdmItemgetHead ()
 Get the first item in the sequence.
 
bool isAtomic ()
 Determine whether the item is an atomic value or some other type of item.
 
int getHashCode ()
 Get a hashcode that reflects the rules for equality matching.
 
XDM_TYPE getType ()
 
- Public Member Functions inherited from XdmItem
 XdmItem ()
 XdmItem default constructor.
 
 XdmItem (int64_t)
 
 XdmItem (const XdmItem &item)
 Copy constructor.
 
virtual ~XdmItem ()
 Destructor.
 
virtual void incrementRefCount ()
 
virtual void decrementRefCount ()
 
virtual bool isNode ()
 
virtual bool isFunction ()
 
virtual bool isMap ()
 
virtual bool isArray ()
 
virtual int64_t getUnderlyingValue ()
 
const char * toString ()
 
XdmItemitemAt (int n)
 
int size ()
 
- Public Member Functions inherited from XdmValue
 XdmValue ()
 A default Constructor.
 
 XdmValue (const XdmValue &other)
 A copy constructor.
 
XdmValueaddXdmValueWithType (const char *tStr, const char *val)
 Add an XdmItem to the sequence.
 
void addXdmItem (XdmItem *val)
 
void addXdmItemFromUnderlyingValue (XdmItem *val)
 
void addUnderlyingValue (int64_t val)
 
 XdmValue (int64_t val, bool arrFlag)
 A Constructor for handling XdmArray - Internal user only.
 
 XdmValue (int64_t val)
 A Constructor.
 
virtual ~XdmValue ()
 Destructor.
 
void releaseXdmValue ()
 
int getRefCount ()
 Get the number of references on this XdmValue.
 
void resetRelinquishedItems ()
 
void incrementRefCountForRelinquishedValue (int i)
 

Additional Inherited Members

- Protected Member Functions inherited from XdmValue
void initialize ()
 initialize this XdmValue with default values
 
- Protected Attributes inherited from XdmItem
int64_t value
 
const char * stringValue
 
const char * itemToString
 
- Protected Attributes inherited from XdmValue
char * valueType
 
XdmItem ** values
 
char * relinquished_values
 
int values_cap
 
int xdmSize
 
int refCount
 

Detailed Description

The class XdmAtomicValue represents an item in an XPath sequence that is an atomic value. The value may belong to any of the 19 primitive types defined in XML Schema, or to a type derived from these primitive types, or the XPath type xs:untypedAtomic. The type may be either a built-in type or a user-defined type.

An XdmAtomicValue is immutable.

Constructor & Destructor Documentation

◆ XdmAtomicValue() [1/4]

XdmAtomicValue::XdmAtomicValue ( )

A default Constructor.

Create a empty atomic value

◆ XdmAtomicValue() [2/4]

XdmAtomicValue::XdmAtomicValue ( const XdmAtomicValue & other)

A copy constructor.

Parameters
other- XdmAtomicValue

◆ ~XdmAtomicValue()

XdmAtomicValue::~XdmAtomicValue ( )
virtual

Destructor.

Destructor for this XdmAtomicValue

◆ XdmAtomicValue() [3/4]

XdmAtomicValue::XdmAtomicValue ( int64_t val)

A Java Wrapper Constructor.

Wrap a Java XdmAtomicValue object.

Parameters
val- Java XdmAtomicValue object

◆ XdmAtomicValue() [4/4]

XdmAtomicValue::XdmAtomicValue ( int64_t val,
const char * ty )

A Java Wrapper Constructor.

Wrap a Java XdmAtomicValue object.

Parameters
val- Java XdmAtomicValue object
ty- type of the XdmAtomicValue

Member Function Documentation

◆ getBooleanValue()

bool XdmAtomicValue::getBooleanValue ( )

Get the value converted to a boolean using the XPath casting rules.

Returns
the result of converting to a boolean (Note: this is not the same as the effective boolean value).
Remarks
false if the value cannot be cast to a boolean. Exception will be thrown which can be retrieved via the getException method on the Processor

◆ getDoubleValue()

double XdmAtomicValue::getDoubleValue ( )

Get the value converted to a double using the XPath casting rules.

If the value is a string, the XSD 1.1 rules are used, which means that the string "+INF" is recognised.

Returns
the result of converting to a double
Remarks
zero if the value cannot be cast to a double. Exception will be thrown which can be retrieved via the getException method on the Processor

◆ getHashCode()

int XdmAtomicValue::getHashCode ( )

Get a hashcode that reflects the rules for equality matching.

Returns
a suitable hashcode

◆ getHead()

XdmItem * XdmAtomicValue::getHead ( )
virtual

Get the first item in the sequence.

Returns
XdmItem or nullptr if sequence is empty

Reimplemented from XdmItem.

◆ getLongValue()

long XdmAtomicValue::getLongValue ( )

Get the value converted to an integer using the XPath casting rules.

Returns
the result of converting to an integer
Remarks
zero if the value cannot be cast to an integer. Exception will be thrown which can be retrieved via the getException method on the Processor

◆ getPrimitiveTypeName()

const char * XdmAtomicValue::getPrimitiveTypeName ( )

Get the primitive type of this atomic value, as a QName.

The primitive types for this purpose are the 19 primitive types of XML Schema, plus xs:integer, xs:dayTimeDuration and xs:yearMonthDuration, and xs:untypedAtomic. For external objects, the result is xs:anyAtomicType.

Returns
a string of the QName naming the primitive type of this atomic value. This will always be an atomic type.

◆ getStringValue()

const char * XdmAtomicValue::getStringValue ( )
virtual

Get the string value of the item.

For a node, this gets the string value of the node. For an atomic value, it has the same effect as casting the value to a string. In all cases the result is the same as applying the XPath string() function.

For atomic values, the result is the same as the result of calling toString. This is not the case for nodes, where toString returns an XML serialization of the node.

Returns
the result of converting the item to a string.

Reimplemented from XdmItem.

◆ getType()

XDM_TYPE XdmAtomicValue::getType ( )
inlinevirtual

Get the type of the object

Reimplemented from XdmItem.

◆ isAtomic()

bool XdmAtomicValue::isAtomic ( )
inlinevirtual

Determine whether the item is an atomic value or some other type of item.

Returns
true if the item is an atomic value, false if it is a node or a function (including maps and arrays)

Reimplemented from XdmItem.

◆ setType()

void XdmAtomicValue::setType ( const char * ty)

Set the type annotation of the atomic value.

Parameters
ty- The annotated type given as a string

The documentation for this class was generated from the following files: