public class SBMLUri extends java.lang.Object
This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. It is a class used in the implementation of extra functionality provided by libSBML.
This class implements functionality for parsing URIs and extracting information about them.
SBMLResolver
,
SBMLFileResolver
Constructor and Description |
---|
SBMLUri(SBMLUri orig)
Copy constructor.
|
SBMLUri(java.lang.String uri)
Creates a new
SBMLUri from the given string URI. |
Modifier and Type | Method and Description |
---|---|
SBMLUri |
cloneObject()
Creates and returns a deep copy of this
SBMLUri object. |
void |
delete()
Explicitly deletes the underlying native object.
|
java.lang.String |
getHost()
Returns the host portion of the stored URI.
|
java.lang.String |
getPath()
Returns the path and filename portion of the stored URI.
|
java.lang.String |
getQuery()
Returns the query portion of the stored URI.
|
java.lang.String |
getScheme()
Returns the scheme of the stored URI.
|
java.lang.String |
getUri()
Returns the full stored URI, after replacing backslashes with slashes.
|
SBMLUri |
relativeTo(java.lang.String uri)
Constructs a new URI relative to this object and the given URI.
|
public SBMLUri(java.lang.String uri)
SBMLUri
from the given string URI.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 SBMLUri.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 SBMLUri.delete()
themselves.
public SBMLUri cloneObject()
SBMLUri
object.
SBMLFileResolver
object.public java.lang.String getScheme()
The scheme of the URI is the text before the first colon character.
Typical examples of what this might return are the strings 'file'
or
'http'.
If the current URI does not have a scheme, this method
returns an empty string.
'http'
, or an empty string if no
scheme exists for the current URI.public java.lang.String getHost()
For a scheme such as 'http'
, this method returns the part of the URI
after 'http:
//' and before the next '
/' character. URIs with file
or URN schemes have no host in that case, this method returns an empty
string.
public java.lang.String getPath()
This method returns the text after the scheme, colon, and host (if
present), and before the next '?'
character. The result may be an
empty string for some URIs.
public java.lang.String getQuery()
The equery portion of a URI is the text after a filename, starting with
the character '?'.
For many URIs, this is an empty string.
public java.lang.String getUri()
public SBMLUri relativeTo(java.lang.String uri)
For example,
SBMLUri
('c:\test').relativeTo('test.xml')
would construct a new file URI, with path
c:/test/test.xml
.
uri
- a URI to be added to this object