libSBML C# API  libSBML 5.8.0 C# API
 All Classes Namespaces Files Functions Variables Properties Pages
libsbmlcs.XMLAttributes Class Reference
Inheritance diagram for libsbmlcs.XMLAttributes:
[legend]

Detailed Description

Representation of attributes on an XML node.

This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. This class is not prescribed by the SBML specifications, although it is used to implement features defined in SBML.

Public Member Functions

int add (string name, string value, string namespaceURI, string prefix)
 Adds an attribute (a name/value pair) to this XMLAttributes object, optionally with a prefix and URI defining a namespace. More...
 
int add (string name, string value, string namespaceURI)
 Adds an attribute (a name/value pair) to this XMLAttributes object, optionally with a prefix and URI defining a namespace. More...
 
int add (string name, string value)
 Adds an attribute (a name/value pair) to this XMLAttributes object, optionally with a prefix and URI defining a namespace. More...
 
int add (XMLTriple triple, string value)
 Adds an attribute with the given XMLTriple/value pair to this XMLAttributes set. More...
 
int clear ()
 Clears (deletes) all attributes in this XMLAttributes object. More...
 
XMLAttributes clone ()
 Creates and returns a deep copy of this XMLAttributes set. More...
 
virtual void Dispose ()
 
override bool Equals (Object sb)
 
override int GetHashCode ()
 
int getIndex (string name)
 Return the index of an attribute with the given name. More...
 
int getIndex (string name, string uri)
 Return the index of an attribute with the given local name and namespace URI. More...
 
int getIndex (XMLTriple triple)
 Return the index of an attribute with the given XMLTriple. More...
 
int getLength ()
 Return the number of attributes in the set. More...
 
string getName (int index)
 Return the local name of an attribute in this XMLAttributes set (by position). More...
 
int getNumAttributes ()
 Return the number of attributes in the set. More...
 
string getPrefix (int index)
 Return the prefix of an attribute in this XMLAttributes set (by position). More...
 
string getPrefixedName (int index)
 Return the prefixed name of an attribute in this XMLAttributes set (by position). More...
 
string getURI (int index)
 Return the namespace URI of an attribute in this XMLAttributes set (by position). More...
 
string getValue (int index)
 Return the value of an attribute in this XMLAttributes set (by position). More...
 
string getValue (string name)
 Return an attribute's value by name. More...
 
string getValue (string name, string uri)
 Return a value of an attribute with the given local name and namespace URI. More...
 
string getValue (XMLTriple triple)
 Return a value of an attribute with the given XMLTriple. More...
 
bool hasAttribute (int index)
 Predicate returning true or false depending on whether an attribute with the given index exists in this XMLAttributes. More...
 
bool hasAttribute (string name, string uri)
 Predicate returning true or false depending on whether an attribute with the given local name and namespace URI exists in this XMLAttributes. More...
 
bool hasAttribute (string name)
 Predicate returning true or false depending on whether an attribute with the given local name and namespace URI exists in this XMLAttributes. More...
 
bool hasAttribute (XMLTriple triple)
 Predicate returning true or false depending on whether an attribute with the given XML triple exists in this XMLAttributes. More...
 
bool isEmpty ()
 Predicate returning true or false depending on whether this XMLAttributes set is empty. More...
 
int remove (int n)
 Removes an attribute with the given index from this XMLAttributes set. More...
 
int remove (string name, string uri)
 Removes an attribute with the given local name and namespace URI from this XMLAttributes set. More...
 
int remove (string name)
 Removes an attribute with the given local name and namespace URI from this XMLAttributes set. More...
 
int remove (XMLTriple triple)
 Removes an attribute with the given XMLTriple from this XMLAttributes set. More...
 
int removeResource (int n)
 Removes an attribute with the given index from this XMLAttributes set. More...
 
 XMLAttributes ()
 Creates a new empty XMLAttributes set. More...
 
 XMLAttributes (XMLAttributes orig)
 Copy constructor; creates a copy of this XMLAttributes set. More...
 

Static Public Member Functions

static bool operator!= (XMLAttributes lhs, XMLAttributes rhs)
 
static bool operator== (XMLAttributes lhs, XMLAttributes rhs)
 

Protected Attributes

bool swigCMemOwn
 

Constructor & Destructor Documentation

libsbmlcs.XMLAttributes.XMLAttributes ( )

Creates a new empty XMLAttributes set.

libsbmlcs.XMLAttributes.XMLAttributes ( XMLAttributes  orig)

Copy constructor; creates a copy of this XMLAttributes set.

orig the XMLAttributes object to copy.

Exceptions
XMLConstructorExceptionThrown if the argument orig is null.

Member Function Documentation

int libsbmlcs.XMLAttributes.add ( string  name,
string  value,
string  namespaceURI,
string  prefix 
)

Adds an attribute (a name/value pair) to this XMLAttributes object, optionally with a prefix and URI defining a namespace.

Parameters
namea string, the local name of the attribute.
valuea string, the value of the attribute.
namespaceURIa string, the namespace URI of the attribute.
prefixa string, the prefix of the namespace
Returns
an integer code indicating the success or failure of the function. The possible values returned by this function are:
Note
if local name with the same namespace URI already exists in this attribute set, its value and prefix will be replaced.
int libsbmlcs.XMLAttributes.add ( string  name,
string  value,
string  namespaceURI 
)

Adds an attribute (a name/value pair) to this XMLAttributes object, optionally with a prefix and URI defining a namespace.

Parameters
namea string, the local name of the attribute.
valuea string, the value of the attribute.
namespaceURIa string, the namespace URI of the attribute.
prefixa string, the prefix of the namespace
Returns
an integer code indicating the success or failure of the function. The possible values returned by this function are:
Note
if local name with the same namespace URI already exists in this attribute set, its value and prefix will be replaced.
int libsbmlcs.XMLAttributes.add ( string  name,
string  value 
)

Adds an attribute (a name/value pair) to this XMLAttributes object, optionally with a prefix and URI defining a namespace.

Parameters
namea string, the local name of the attribute.
valuea string, the value of the attribute.
namespaceURIa string, the namespace URI of the attribute.
prefixa string, the prefix of the namespace
Returns
an integer code indicating the success or failure of the function. The possible values returned by this function are:
Note
if local name with the same namespace URI already exists in this attribute set, its value and prefix will be replaced.
int libsbmlcs.XMLAttributes.add ( XMLTriple  triple,
string  value 
)

Adds an attribute with the given XMLTriple/value pair to this XMLAttributes set.

Note
if local name with the same namespace URI already exists in this attribute set, its value and prefix will be replaced.
Parameters
triplean XMLTriple, the XML triple of the attribute.
valuea string, the value of the attribute.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
int libsbmlcs.XMLAttributes.clear ( )

Clears (deletes) all attributes in this XMLAttributes object.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
XMLAttributes libsbmlcs.XMLAttributes.clone ( )

Creates and returns a deep copy of this XMLAttributes set.

Returns
a (deep) copy of this XMLAttributes set.
virtual void libsbmlcs.XMLAttributes.Dispose ( )
virtual
override bool libsbmlcs.XMLAttributes.Equals ( Object  sb)
override int libsbmlcs.XMLAttributes.GetHashCode ( )
int libsbmlcs.XMLAttributes.getIndex ( string  name)

Return the index of an attribute with the given name.

Note
A namespace bound to the name is not checked by this function. Thus, if there are multiple attributes with the given local name and different namespaces, the smallest index among those attributes will be returned. XMLAttributes::getIndex(string name, string uri) or XMLAttributes::getIndex(XMLTriple triple) should be used to get an index of an attribute with the given local name and namespace.
Parameters
namea string, the local name of the attribute for which the index is required.
Returns
the index of an attribute with the given local name, or -1 if not present.
int libsbmlcs.XMLAttributes.getIndex ( string  name,
string  uri 
)

Return the index of an attribute with the given local name and namespace URI.

Parameters
namea string, the local name of the attribute.
uria string, the namespace URI of the attribute.
Returns
the index of an attribute with the given local name and namespace URI, or -1 if not present.
int libsbmlcs.XMLAttributes.getIndex ( XMLTriple  triple)

Return the index of an attribute with the given XMLTriple.

Parameters
triplean XMLTriple, the XML triple of the attribute for which the index is required.
Returns
the index of an attribute with the given XMLTriple, or -1 if not present.
int libsbmlcs.XMLAttributes.getLength ( )

Return the number of attributes in the set.

Returns
the number of attributes in this XMLAttributes set.
string libsbmlcs.XMLAttributes.getName ( int  index)

Return the local name of an attribute in this XMLAttributes set (by position).

Parameters
indexan integer, the position of the attribute whose local name is required.
Returns
the local name of an attribute in this list (by position).
Note
If index is out of range, an empty string will be returned. Use XMLAttributes::hasAttribute(int index) to test for the attribute existence.
int libsbmlcs.XMLAttributes.getNumAttributes ( )

Return the number of attributes in the set.

Returns
the number of attributes in this XMLAttributes set.

This function is an alias for getLength introduced for consistency with other XML classes.

string libsbmlcs.XMLAttributes.getPrefix ( int  index)

Return the prefix of an attribute in this XMLAttributes set (by position).

Parameters
indexan integer, the position of the attribute whose prefix is required.
Returns
the namespace prefix of an attribute in this list (by position).
Note
If index is out of range, an empty string will be returned. Use XMLAttributes::hasAttribute(int index) to test for the attribute existence.
string libsbmlcs.XMLAttributes.getPrefixedName ( int  index)

Return the prefixed name of an attribute in this XMLAttributes set (by position).

Parameters
indexan integer, the position of the attribute whose prefixed name is required.
Returns
the prefixed name of an attribute in this list (by position).
Note
If index is out of range, an empty string will be returned. Use XMLAttributes::hasAttribute(int index) to test for attribute existence.
string libsbmlcs.XMLAttributes.getURI ( int  index)

Return the namespace URI of an attribute in this XMLAttributes set (by position).

Parameters
indexan integer, the position of the attribute whose namespace URI is required.
Returns
the namespace URI of an attribute in this list (by position).
Note
If index is out of range, an empty string will be returned. Use XMLAttributes::hasAttribute(int index) to test for attribute existence.
string libsbmlcs.XMLAttributes.getValue ( int  index)

Return the value of an attribute in this XMLAttributes set (by position).

Parameters
indexan integer, the position of the attribute whose value is required.
Returns
the value of an attribute in the list (by position).
Note
If index is out of range, an empty string will be returned. Use XMLAttributes::hasAttribute(int index) to test for attribute existence.
string libsbmlcs.XMLAttributes.getValue ( string  name)

Return an attribute's value by name.

Parameters
namea string, the local name of the attribute whose value is required.
Returns
The attribute value as a string.
Note
If an attribute with the given local name does not exist, an empty string will be returned. Use XMLAttributes::hasAttribute(string name, string uri) const to test for attribute existence. A namespace bound to the local name is not checked by this function. Thus, if there are multiple attributes with the given local name and different namespaces, the value of an attribute with the smallest index among those attributes will be returned. XMLAttributes::getValue(string name) or XMLAttributes::getValue(XMLTriple triple) should be used to get a value of an attribute with the given local name and namespace.
string libsbmlcs.XMLAttributes.getValue ( string  name,
string  uri 
)

Return a value of an attribute with the given local name and namespace URI.

Parameters
namea string, the local name of the attribute whose value is required.
uria string, the namespace URI of the attribute.
Returns
The attribute value as a string.
Note
If an attribute with the given local name and namespace URI does not exist, an empty string will be returned. Use XMLAttributes::hasAttribute(string name, string uri) const to test for attribute existence.
string libsbmlcs.XMLAttributes.getValue ( XMLTriple  triple)

Return a value of an attribute with the given XMLTriple.

Parameters
triplean XMLTriple, the XML triple of the attribute whose value is required.
Returns
The attribute value as a string.
Note
If an attribute with the given XMLTriple does not exist, an empty string will be returned. Use XMLAttributes::hasAttribute(XMLTriple triple) to test for attribute existence.
bool libsbmlcs.XMLAttributes.hasAttribute ( int  index)

Predicate returning true or false depending on whether an attribute with the given index exists in this XMLAttributes.

Parameters
indexan integer, the position of the attribute.
Returns
true if an attribute with the given index exists in this XMLAttributes, false otherwise.
bool libsbmlcs.XMLAttributes.hasAttribute ( string  name,
string  uri 
)

Predicate returning true or false depending on whether an attribute with the given local name and namespace URI exists in this XMLAttributes.

Parameters
namea string, the local name of the attribute.
uria string, the namespace URI of the attribute.
Returns
true if an attribute with the given local name and namespace URI exists in this XMLAttributes, false otherwise.
bool libsbmlcs.XMLAttributes.hasAttribute ( string  name)

Predicate returning true or false depending on whether an attribute with the given local name and namespace URI exists in this XMLAttributes.

Parameters
namea string, the local name of the attribute.
uria string, the namespace URI of the attribute.
Returns
true if an attribute with the given local name and namespace URI exists in this XMLAttributes, false otherwise.
bool libsbmlcs.XMLAttributes.hasAttribute ( XMLTriple  triple)

Predicate returning true or false depending on whether an attribute with the given XML triple exists in this XMLAttributes.

Parameters
triplean XMLTriple, the XML triple of the attribute
Returns
true if an attribute with the given XML triple exists in this XMLAttributes, false otherwise.
bool libsbmlcs.XMLAttributes.isEmpty ( )

Predicate returning true or false depending on whether this XMLAttributes set is empty.

Returns
true if this XMLAttributes set is empty, false otherwise.
static bool libsbmlcs.XMLAttributes.operator!= ( XMLAttributes  lhs,
XMLAttributes  rhs 
)
static
static bool libsbmlcs.XMLAttributes.operator== ( XMLAttributes  lhs,
XMLAttributes  rhs 
)
static
int libsbmlcs.XMLAttributes.remove ( int  n)

Removes an attribute with the given index from this XMLAttributes set.

(This function is an alias of XMLAttributes::removeResource() ).

Parameters
nan integer the index of the resource to be deleted
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
int libsbmlcs.XMLAttributes.remove ( string  name,
string  uri 
)

Removes an attribute with the given local name and namespace URI from this XMLAttributes set.

Parameters
namea string, the local name of the attribute.
uria string, the namespace URI of the attribute.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
int libsbmlcs.XMLAttributes.remove ( string  name)

Removes an attribute with the given local name and namespace URI from this XMLAttributes set.

Parameters
namea string, the local name of the attribute.
uria string, the namespace URI of the attribute.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
int libsbmlcs.XMLAttributes.remove ( XMLTriple  triple)

Removes an attribute with the given XMLTriple from this XMLAttributes set.

Parameters
triplean XMLTriple, the XML triple of the attribute.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
int libsbmlcs.XMLAttributes.removeResource ( int  n)

Removes an attribute with the given index from this XMLAttributes set.

Parameters
nan integer the index of the resource to be deleted
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:

Member Data Documentation

bool libsbmlcs.XMLAttributes.swigCMemOwn
protected