public class LayoutExtension extends SBMLExtension
Constructor and Description |
---|
LayoutExtension()
Creates a new
LayoutExtension instance. |
LayoutExtension(LayoutExtension arg0)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addL2Namespaces(XMLNamespaces xmlns)
adds all L2 Extension namespaces to the namespace list.
|
LayoutExtension |
cloneObject()
Creates and returns a deep copy of this
LayoutExtension object. |
void |
delete()
Explicitly deletes the underlying native object.
|
void |
enableL2NamespaceForDocument(SBMLDocument doc)
Adds the L2 Namespace to the document and enables the extension.
|
static long |
getDefaultLevel()
Returns the default SBML Level used by this libSBML package extension.
|
static long |
getDefaultPackageVersion()
Returns the default version of the SBML Level 3 package implemented
by this libSBML extension.
|
static long |
getDefaultVersion()
Returns the default SBML Version used by this libSBML package extension.
|
long |
getLevel(java.lang.String uri)
Returns the SBML Level for the given URI of this package.
|
java.lang.String |
getName()
Returns the name of this package ('layout')
|
static java.lang.String |
getPackageName()
Returns the nickname of the SBML Level 3 package implemented by
this libSBML extension.
|
long |
getPackageVersion(java.lang.String uri)
Returns the SBML Level 3 package version for the given URI of this
package.
|
SBMLNamespaces |
getSBMLExtensionNamespaces(java.lang.String uri)
Returns an
LayoutPkgNamespaces object. |
java.lang.String |
getStringFromTypeCode(int typeCode)
Takes a type code of the &ldquolayout&rdquo package and returns a string
describing the code.
|
java.lang.String |
getURI(long sbmlLevel,
long sbmlVersion,
long pkgVersion)
Returns the namespace URI corresponding to the combination of the given
SBML Level, Version, and package version.
|
long |
getVersion(java.lang.String uri)
Returns the Version within the SBML Level for the given URI of this
package.
|
static java.lang.String |
getXmlnsL2()
Returns the XML namespace URI of the SBML Level 2 version
of the package implemented by this libSBML Extension.
|
static java.lang.String |
getXmlnsL3V1V1()
Returns the XML namespace URI of the SBML Level 3 package
implemented by this libSBML extension.
|
static java.lang.String |
getXmlnsXSI()
Returns the XML namespace URI of any additional XML namespaces needed
or used by this SBML Level 3 package.
|
boolean |
isInUse(SBMLDocument doc)
Determines whether this extension is being used by the given
SBMLDocument |
void |
removeL2Namespaces(XMLNamespaces xmlns)
Removes the L2 Namespace from a document.
|
getNumOfSBasePlugins, getNumOfSupportedPackageURI, getSupportedPackageURI, isEnabled, isSupported, setEnabled
public LayoutExtension()
LayoutExtension
instance.public LayoutExtension(LayoutExtension arg0)
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 LayoutExtension.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 LayoutExtension.delete()
themselves.
delete
 in class SBMLExtension
public static java.lang.String getPackageName()
public static long getDefaultLevel()
public static long getDefaultVersion()
public static long getDefaultPackageVersion()
public static java.lang.String getXmlnsL3V1V1()
public static java.lang.String getXmlnsL2()
Unique among the SBML Level 3 packages, the Layout
package existed
and was in widespread use prior to the introduction of SBML
Level 3. The Layout
package was used as model annotations in SBML
Level 2. This method returns the SBML annotation XML namespace
used for Level 2.
public static java.lang.String getXmlnsXSI()
public LayoutExtension cloneObject()
LayoutExtension
object.
cloneObject
 in class SBMLExtension
LayoutExtension
objectpublic java.lang.String getName()
getName
 in class SBMLExtension
public java.lang.String getURI(long sbmlLevel, long sbmlVersion, long pkgVersion)
getURI
 in class SBMLExtension
sbmlLevel
- the level of SBMLsbmlVersion
- the version of SBMLpkgVersion
- the version of package
public long getLevel(java.lang.String uri)
getLevel
 in class SBMLExtension
uri
- a URI that represents a version of this package.
0
if the
given URI is invalid.public long getVersion(java.lang.String uri)
getVersion
 in class SBMLExtension
uri
- a URI that represents a version of this package.
0
if the given URI is invalid.public long getPackageVersion(java.lang.String uri)
getPackageVersion
 in class SBMLExtension
uri
- a URI that represents one of the valid versions of this
package.
0
if the given URI is invalid.public java.lang.String getStringFromTypeCode(int typeCode)
getStringFromTypeCode
 in class SBMLExtension
typeCode
- a libSBML type code defined by the libSBML extension
implementing support for the SBML Level 3 &ldquolayout&rdquo package.
typeCode
.
If the type code is unrecognized for this implementation of the libSBML
&ldquolayout&rdquo package, the string returned will be
'(Unknown SBML Layout
Type)'
.public SBMLNamespaces getSBMLExtensionNamespaces(java.lang.String uri)
LayoutPkgNamespaces
object.
getSBMLExtensionNamespaces
 in class SBMLExtension
uri
- a URI that represents one of the valid versions of the
&ldquolayout&rdquo package
uri
,
or null
if the URI is not defined in the Layout
package.public void removeL2Namespaces(XMLNamespaces xmlns)
This method should be overridden by all extensions that want to serialize to an L2 annotation.
removeL2Namespaces
 in class SBMLExtension
xmlns
- an XMLNamespaces
object that will be used for the annotation.
Implementations should override this method with something that removes
the package's namespace(s) from the set of namespaces in xmlns
. For
instance, here is the code from the Layout package extension:
{.cpp}
for (int n = 0 n < xmlns->getNumNamespaces() n++)
{
if (xmlns->getURI(n) == LayoutExtension.getXmlnsL2()
)
xmlns->remove(n)
}
public void addL2Namespaces(XMLNamespaces xmlns)
This method should be overridden by all extensions that want to serialize to an L2 annotation.
addL2Namespaces
 in class SBMLExtension
xmlns
- an XMLNamespaces
object that will be used for the annotation.
Implementation should override this method with something that adds
the package's namespace(s) to the set of namespaces in xmlns
. For
instance, here is the code from the Layout package extension:
{.cpp} if (!xmlns->containsUri(LayoutExtension.getXmlnsL2()
)) xmlns->add(LayoutExtension.getXmlnsL2()
, 'layout')
public void enableL2NamespaceForDocument(SBMLDocument doc)
If the extension supports serialization to SBML L2 Annotations, this method should be overrridden, so it will be activated.
enableL2NamespaceForDocument
 in class SBMLExtension
doc
- the SBMLDocument
object for the model.
Implementations should override this method with something that
enables the package based on the package's namespace(s). For example,
here is the code from the Layout package extension:
{.cpp}
if (doc->getLevel() == 2)
doc->enablePackage(LayoutExtension.getXmlnsL2()
, 'layout', true)
public boolean isInUse(SBMLDocument doc)
SBMLDocument
The implementation returns true if the model object contains one or more layouts.
isInUse
 in class SBMLExtension
doc
- the sbml document to test.