public class XMLTriple extends java.lang.Object
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.
A 'triple' in the libSBML XML layer encapsulates the notion of qualified
name, meaning an element name or an attribute name with an optional
namespace qualifier. An XMLTriple instance carries up to three data items:
mysim and it appears on both the element
someelement and the attribute attribA. When
both the element and the attribute are stored as XMLTriple objects,
their prefix is mysim.
<mysim:someelement mysim:attribA='value' />
XMLTriple objects are the lowest-level data item in the XML layer
of libSBML. Other objects such as XMLToken make use of XMLTriple
objects.
| Constructor and Description |
|---|
XMLTriple()
Creates a new, empty
XMLTriple. |
XMLTriple(java.lang.String triplet)
|
XMLTriple(java.lang.String triplet,
char sepchar)
|
XMLTriple(java.lang.String name,
java.lang.String uri,
java.lang.String prefix)
|
XMLTriple(XMLTriple orig)
Copy constructor creates a copy of this
XMLTriple set. |
| Modifier and Type | Method and Description |
|---|---|
XMLTriple |
cloneObject()
Creates and returns a deep copy of this
XMLTriple set. |
void |
delete()
Explicitly deletes the underlying native object.
|
boolean |
equals(java.lang.Object sb)
Equality comparison method for XMLTriple.
|
java.lang.String |
getName()
Returns the name portion of this
XMLTriple. |
java.lang.String |
getPrefix()
Returns the prefix portion of this
XMLTriple. |
java.lang.String |
getPrefixedName()
Returns the prefixed name from this
XMLTriple. |
java.lang.String |
getURI()
Returns the URI portion of this
XMLTriple. |
int |
hashCode()
Returns a hashcode for this XMLTriple object.
|
boolean |
isEmpty()
|
public XMLTriple(java.lang.String triplet)
XMLTriple by splitting the given triplet on the
separator character sepchar.
Triplet may be in one of the following formats:
triplet - a string representing the triplet as abovesepchar - a character, the sepchar used in the triplet
XMLConstructorException - Thrown if the argument orig is null.
public XMLTriple(java.lang.String triplet, char sepchar)
XMLTriple by splitting the given triplet on the
separator character sepchar.
Triplet may be in one of the following formats:
triplet - a string representing the triplet as abovesepchar - a character, the sepchar used in the triplet
XMLConstructorException - Thrown if the argument orig is null.
public XMLTriple(java.lang.String name, java.lang.String uri, java.lang.String prefix)
name - a string, name for the XMLTriple.uri - a string, URI of the XMLTriple.prefix - a string, prefix for the URI of the XMLTriple,
XMLConstructorException - Thrown if the argument orig is null.public XMLTriple(XMLTriple orig)
XMLTriple set.
orig - the XMLTriple object to copy.
XMLConstructorException - Thrown if the argument orig is null.public XMLTriple cloneObject()
XMLTriple set.
XMLTriple set.public void delete()
In general, application software will not need to call this method directly. The Java language binding for libSBML is implemented as a language wrapper that provides a Java interface to libSBML's underlying C++/C code. Some of the Java methods return objects that are linked to objects created not by Java code, but by C++ code. The Java objects wrapped around them will be deleted when the garbage collector invokes the corresponding C++ finalize() methods for the objects. The finalize() methods in turn call the XMLTriple.delete() method on the libSBML object.
This method is exposed in case calling programs want to ensure that the underlying object is freed immediately, and not at some arbitrary time determined by the Java garbage collector. In normal usage, callers do not need to invoke XMLTriple.delete() themselves.
public boolean equals(java.lang.Object sb)
Because the Java methods for libSBML are actually wrappers around code
implemented in C++ and C, certain operations will not behave as
expected. Equality comparison is one such case. An instance of a
libSBML object class is actually a proxy object
wrapping the real underlying C/C++ object. The normal ==
equality operator in Java will only compare the Java proxy objects,
not the underlying native object. The result is almost never what you
want in practical situations. Unfortunately, Java does not provide a
way to override ==.
The alternative that must be followed is to use the
equals() method. The equals method on this
class overrides the default java.lang.Object one, and performs an
intelligent comparison of instances of objects of this class. The
result is an assessment of whether two libSBML Java objects are truly
the same underlying native-code objects.
The use of this method in practice is the same as the use of any other
Java equals method. For example,
a.equals(b) returns
true if a and b are references to the
same underlying object.
equals in class java.lang.Objectsb - a reference to an object to which the current object
instance will be comparedtrue if sb refers to the same underlying
native object as this one, false otherwisepublic java.lang.String getName()
XMLTriple.
XMLTriple.public java.lang.String getPrefix()
XMLTriple.
XMLTriple.public java.lang.String getPrefixedName()
XMLTriple.
XMLTriple.public java.lang.String getURI()
XMLTriple.
XMLTriple.public int hashCode()
hashCode in class java.lang.Object