SaxonC 12.5
Saxon Processor library for C/C++, PHP and Python
|
#include <XdmMap.h>
Public Member Functions | |
XdmMap () | |
Default constructor. | |
XdmMap (const XdmMap &d) | |
Copy constructor. | |
virtual | ~XdmMap () |
Destructor. | |
XdmMap (int64_t obj) | |
XdmMap (std::map< XdmAtomicValue *, XdmValue * > map) | |
int | mapSize () |
Get the number of entries in the map. | |
XdmValue * | get (XdmAtomicValue *key) |
XdmValue * | get (const char *key) |
XdmValue * | get (int key) |
XdmValue * | get (double key) |
XdmValue * | get (long key) |
XdmMap * | put (XdmAtomicValue *key, XdmValue *value) |
Create a new map containing an additional (key, value) pair. | |
XdmMap * | remove (XdmAtomicValue *key) |
Create a new map in which the entry for a given key has been removed. | |
std::set< XdmAtomicValue * > | keySet () |
Get the keys present in the map in the form of an unordered std::set. | |
XdmAtomicValue ** | keys () |
bool | isEmpty () |
Returns true if this map contains no key-value mappings. | |
bool | containsKey (XdmAtomicValue *key) |
std::list< XdmValue * > | valuesAsList () |
XdmValue ** | values () |
bool | isFunction () |
Determine whether the item is a function or some other type of item. | |
bool | isMap () |
Determine whether the item is a map or some other type of item. | |
XDM_TYPE | getType () |
Get the type of the object. | |
const char * | toString () |
Public Member Functions inherited from XdmFunctionItem | |
XdmFunctionItem () | |
Default constructor for XdmFunctionItem. | |
XdmFunctionItem (int64_t obj) | |
XdmFunctionItem constructor created from a Java object - internal use. | |
XdmFunctionItem (const XdmFunctionItem &d) | |
Copy constructor. | |
virtual | ~XdmFunctionItem () |
Destructor. | |
const char * | getName () |
Get the name of the function as EQName. | |
virtual int | getArity () |
Get the arity of the function. | |
const char * | getStringValue () |
Get the string value of the XdmArray item. | |
XdmValue ** | createXdmValueArray (int len) |
XdmValue * | call (SaxonProcessor *processor, XdmValue **arguments, int argument_length) |
Call the function. | |
bool | isAtomic () |
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 | isArray () |
virtual int64_t | getUnderlyingValue () |
virtual XdmItem * | getHead () |
XdmItem * | itemAt (int n) |
int | size () |
Public Member Functions inherited from XdmValue | |
XdmValue () | |
A default Constructor. | |
XdmValue (const XdmValue &other) | |
A copy constructor. | |
XdmValue * | addXdmValueWithType (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 | |
Static Public Member Functions inherited from XdmFunctionItem | |
static XdmFunctionItem * | getSystemFunction (SaxonProcessor *processor, const char *name, int arity) |
Get a system function. | |
Protected Member Functions inherited from XdmFunctionItem | |
XdmValue * | getXdmValueSubClass (int64_t value) |
Protected Member Functions inherited from XdmValue | |
void | initialize () |
initialize this XdmValue with default values | |
Protected Attributes inherited from XdmFunctionItem | |
char * | fname |
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 |
A map in the XDM data model. A map is a list of zero or more entries, each of which is a pair comprising a key (which is an atomic value) and a value (which is an arbitrary value). The map itself is an XDM item.
An XdmMap is immutable.
XdmMap::XdmMap | ( | ) |
Default constructor.
Create an empty XdmMap
|
inlinevirtual |
Destructor.
Destructor for XdmMap
XdmMap::XdmMap | ( | int64_t | obj | ) |
XdmMap::XdmMap | ( | std::map< XdmAtomicValue *, XdmValue * > | map | ) |
Create an XdmMap supplying the entries in the form of a std::map, where the keys and values in the std::map are XDM values
map | - a std::map whose entries are the (key, value) pairs |
bool XdmMap::containsKey | ( | XdmAtomicValue * | key | ) |
Returns true
if this map contains a mapping for the specified key. More formally, returns true if and only if this map contains a mapping for a key k such that (key==null ? k==null : key.equals(k))
. (There can be at most one such mapping.)
key | key whose presence in this map is to be tested |
true
if this map contains a mapping for the specified key XdmValue * XdmMap::get | ( | const char * | key | ) |
Returns the value to which the specified string-valued key is mapped, or NULL if this map contains no mapping for the key. This is a convenience method to save the trouble of converting the String to an XdmAtomicValue
.
key | the key whose associated value is to be returned. This is treated as an instance of xs:string (which will also match entries whose key is xs:untypedAtomic or xs:anyURI ) |
XdmValue * XdmMap::get | ( | double | key | ) |
Returns the value to which the specified double-valued key is mapped, or NULL if this map contains no mapping for the key. This is a convenience method to save the trouble of converting the double to an XdmAtomicValue
.
key | the key whose associated value is to be returned. This is treated as an instance of xs:double (which will also match entries whose key belongs to another numeric type) |
XdmValue * XdmMap::get | ( | int | key | ) |
Returns the value to which the specified integer-valued key is mapped or NULL if this map contains no mapping for the key. This is a convenience method to save the trouble of converting the integer to an XdmAtomicValue
.
key | the key whose associated value is to be returned. This is treated as an instance of xs:integer (which will also match entries whose key belongs to another numeric type) |
XdmValue * XdmMap::get | ( | long | key | ) |
Returns the value to which the specified integer-valued key is mapped or NULL if this map contains no mapping for the key. This is a convenience method to save the trouble of converting the integer to an XdmAtomicValue
.
key | the key whose associated value is to be returned. This is treated as an instance of xs:integer (which will also match entries whose key belongs to another numeric type) |
XdmValue * XdmMap::get | ( | XdmAtomicValue * | key | ) |
Returns the value to which the specified key is mapped, or NULL if this map contains no mapping for the key.
key | the key whose associated value is to be returned. |
|
inlinevirtual |
Get the type of the object.
Reimplemented from XdmFunctionItem.
bool XdmMap::isEmpty | ( | ) |
Returns true if this map contains no key-value mappings.
|
inlinevirtual |
Determine whether the item is a function or some other type of item.
Reimplemented from XdmFunctionItem.
|
inlinevirtual |
Determine whether the item is a map or some other type of item.
Reimplemented from XdmItem.
XdmAtomicValue ** XdmMap::keys | ( | ) |
Get the keys present in the map in the form of an unordered pointer array of XdmAtomicValue.
std::set< XdmAtomicValue * > XdmMap::keySet | ( | ) |
Get the keys present in the map in the form of an unordered std::set.
int XdmMap::mapSize | ( | ) |
Get the number of entries in the map.
size()
method returns 1 (one), because an XDM map is an item.) XdmMap * XdmMap::put | ( | XdmAtomicValue * | key, |
XdmValue * | value ) |
Create a new map containing an additional (key, value) pair.
If there is an existing entry with the same key, it is removed
XdmMap * XdmMap::remove | ( | XdmAtomicValue * | key | ) |
Create a new map in which the entry for a given key has been removed.
If there is no entry with the same key, the new map has the same content as the old (it may or may not be the same Java object)
key | - The key to be removed given as an XdmAtomicValue |
|
virtual |
The toString() method returns a simple XML serialization of the node with defaulted serialization parameters.
In the case of an element node, the result will be a well-formed XML document serialized as defined in the W3C XSLT/XQuery serialization specification, using options method="xml", indent="yes", omit-xml-declaration="yes".
In the case of a document node, the result will be a well-formed XML document provided that the document node contains exactly one element child, and no text node children. In other cases it will be a well-formed external general parsed entity.
In the case of an attribute node, the output is a string in the form name="value"
. The name will use the original namespace prefix.
In the case of a namespace node, the output is a string in the form of a namespace declaration, that is xmlns="uri"
or xmlns:pre="uri"
.
Other nodes, such as text nodes, comments, and processing instructions, are represented as they would appear in lexical XML. Note: this means that in the case of text nodes, special characters such as &
and <
are output in escaped form. To get the unescaped string value of a text node, use getStringValue()
instead.
Reimplemented from XdmItem.
XdmValue ** XdmMap::values | ( | ) |
Returns a pointer array containing the values found in this map, that is, the value parts of the key-value pairs.
std::list< XdmValue * > XdmMap::valuesAsList | ( | ) |
Returns a std::list containing the values found in this map, that is, the value parts of the key-value pairs.