public class Association extends SBase
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.
The Association
class is a helper class for creating annotations to store
gene association information in Version 1 of the SBML Level 3
Flux Balance Constraints (&ldquofbc&rdquo) package. In &ldquofbc&rdquo
Version 2, the equivalent capability is handled by the FbcAssociation
class and this class (Association) is not used.
FbcAssociation
,
ListOfFbcAssociations
Constructor and Description |
---|
Association()
Creates a new
Association objet with the given SBML Level, Version, and
&ldquofbc&rdquo package version. |
Association(Association source)
Copy constructor.
|
Association(FbcPkgNamespaces fbcns)
Creates a new
Association with the given FbcPkgNamespaces object. |
Association(long level)
Creates a new
Association objet with the given SBML Level, Version, and
&ldquofbc&rdquo package version. |
Association(long level,
long version)
Creates a new
Association objet with the given SBML Level, Version, and
&ldquofbc&rdquo package version. |
Association(long level,
long version,
long pkgVersion)
Creates a new
Association objet with the given SBML Level, Version, and
&ldquofbc&rdquo package version. |
Association(XMLNode node,
FbcPkgNamespaces fbcns)
Creates a new
Association with the given FbcPkgNamespaces object,
and constructed to mimic the XMLNode: a '<gene>' node
argument will result in a
GENE_ASSOCIATION node an
<and> node argument will result in a
AND_ASSOCIATION node an
<or> node argument will result in a
OR_ASSOCIATION node. |
Modifier and Type | Method and Description |
---|---|
int |
addAssociation(Association association)
Adds a child
Association to this Association object. |
int |
addGene(java.lang.String id)
Adds a gene with the given
id to the association. |
int |
clearAssociations()
Removes all children of this
Association object. |
Association |
cloneObject()
Creates and returns a deep copy of this
Association object. |
Association |
createAnd()
Creates a new
Association of type 'and'. |
Association |
createGene()
Creates a new
Association of type 'and' with a given gene reference. |
Association |
createGene(java.lang.String reference)
Creates a new
Association of type 'and' with a given gene reference. |
Association |
createOr()
Creates a new
Association of type 'or'. |
void |
delete()
Explicitly deletes the underlying native object.
|
java.lang.String |
getElementName()
Returns the XML element name of this SBML object.
|
long |
getNumAssociations()
Returns the number of child Associations of this
Association object. |
java.lang.String |
getReference()
Returns the string of the 'reference' attribute of this
Association object. |
int |
getType()
Returns the string of the 'type' attribute of this
Association object. |
int |
getTypeCode()
Returns the libSBML type code of this object instance.
|
boolean |
isSetReference()
Predicate returning
true if this Association 's 'reference' attribute
has been set. |
boolean |
isSetType()
Predicate returning
true if this Association 's 'type' attribute is
set. |
static Association |
parseInfixAssociation(java.lang.String association)
Parses a gene association in infix format and returns a corresponding
Association object. |
int |
removeAssociation(int index)
Removes the child Associations with the given
index from this
Association object. |
int |
setReference(java.lang.String reference)
Sets the SIdRef string of the 'reference' attribute of this
Association object. |
int |
setType(int type)
Sets the SIdRef string of the 'type' attribute of this
Association object. |
java.lang.String |
toInfix()
Converts this
Association object into an infix string representation. |
XMLNode |
toXML()
Creates an
XMLNode object from this Association object. |
int |
unsetReference()
Unsets the value of the 'id' attribute of this
Association object. |
int |
unsetType()
Unsets the value of the 'id' attribute of this
Association object. |
addCVTerm, addCVTerm, appendAnnotation, appendAnnotation, appendNotes, appendNotes, connectToChild, deleteDisabledPlugins, deleteDisabledPlugins, disablePackage, enablePackage, equals, getAncestorOfType, getAncestorOfType, getAnnotation, getAnnotationString, getColumn, getCVTerm, getCVTerms, getDisabledPlugin, getElementByMetaId, getElementBySId, getId, getIdAttribute, getLevel, getLine, getListOfAllElements, getListOfAllElements, getListOfAllElementsFromPlugins, getListOfAllElementsFromPlugins, getMetaId, getModel, getModelHistory, getName, getNamespaces, getNotes, getNotesString, getNumCVTerms, getNumDisabledPlugins, getNumPlugins, getObjectVersion, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getPlugin, getPrefix, getResourceBiologicalQualifier, getResourceModelQualifier, getSBMLDocument, getSBOTerm, getSBOTermAsURL, getSBOTermID, getURI, getVersion, hashCode, hasValidLevelVersionNamespaceCombination, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetId, isSetIdAttribute, isSetMetaId, isSetModelHistory, isSetName, isSetNotes, isSetSBOTerm, isSetUserData, matchesRequiredSBMLNamespacesForAddition, matchesSBMLNamespaces, removeFromParentAndDelete, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameMetaIdRefs, renameSIdRefs, renameUnitSIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setId, setIdAttribute, setMetaId, setModelHistory, setName, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetId, unsetIdAttribute, unsetMetaId, unsetModelHistory, unsetName, unsetNotes, unsetSBOTerm, unsetUserData
public Association(long level, long version, long pkgVersion) throws SBMLConstructorException
Association
objet with the given SBML Level, Version, and
&ldquofbc&rdquo package version.
level
- the SBML Level.version
- the Version within the SBML Level.pkgVersion
- the version of the package.
SBMLConstructorException
SBMLDocument
having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument
), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public Association(long level, long version) throws SBMLConstructorException
Association
objet with the given SBML Level, Version, and
&ldquofbc&rdquo package version.
level
- the SBML Level.version
- the Version within the SBML Level.pkgVersion
- the version of the package.
SBMLConstructorException
SBMLDocument
having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument
), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public Association(long level) throws SBMLConstructorException
Association
objet with the given SBML Level, Version, and
&ldquofbc&rdquo package version.
level
- the SBML Level.version
- the Version within the SBML Level.pkgVersion
- the version of the package.
SBMLConstructorException
SBMLDocument
having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument
), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public Association() throws SBMLConstructorException
Association
objet with the given SBML Level, Version, and
&ldquofbc&rdquo package version.
level
- the SBML Level.version
- the Version within the SBML Level.pkgVersion
- the version of the package.
SBMLConstructorException
SBMLDocument
having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument
), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public Association(XMLNode node, FbcPkgNamespaces fbcns) throws SBMLConstructorException
Association
with the given FbcPkgNamespaces
object,
and constructed to mimic the XMLNode: a '<gene>' node
argument will result in a
GENE_ASSOCIATION
node an
<and> node argument will result in a
AND_ASSOCIATION
node an
<or> node argument will result in a
OR_ASSOCIATION
node. Any
other node will result in a
UNKNOWN_ASSOCIATION
node.
'And' and 'or' nodes will have Association
children that again
parallel the children of the given XMLNode
.
The package namespaces object used in this constructor is derived from a
SBMLNamespaces
object, which encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
package version and name information used in addition to SBML Level 3 Core. A
common approach to using libSBML's SBMLNamespaces
facilities is to create an
package namespace object somewhere in a program once, then hand that object
as needed to object constructors of that package that accept it as and
argument, such as this one.
fbcns
- the FbcPkgNamespaces
object.node
- the XMLNode
to copy.
SBMLConstructorException
SBMLDocument
having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument
), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public Association(FbcPkgNamespaces fbcns) throws SBMLConstructorException
Association
with the given FbcPkgNamespaces
object.
The package namespaces object used in this constructor is derived from a
SBMLNamespaces
object, which encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
package version and name information used in addition to SBML Level 3 Core. A
common approach to using libSBML's SBMLNamespaces
facilities is to create an
package namespace object somewhere in a program once, then hand that object
as needed to object constructors of that package that accept it as and
argument, such as this one.
fbcns
- the FbcPkgNamespaces
object.
SBMLConstructorException
SBMLDocument
having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument
), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public Association(Association source) throws SBMLConstructorException
source
- the instance to copy.SBMLConstructorException
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 Association.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 Association.delete()
themselves.
public int getType()
Association
object.
Association
object.public boolean isSetType()
true
if this Association
's 'type' attribute is
set.
true
if this Association
object's 'type' attribute has been set,
otherwise false
is returned.public int setType(int type)
Association
object.
type
- a SIdRef string to be set.
public int unsetType()
Association
object.
public java.lang.String getReference()
Association
object.
Association
object.public boolean isSetReference()
true
if this Association
's 'reference' attribute
has been set.
true
if this Association
object's 'reference' attribute has been set,
otherwise false
is returned.public int setReference(java.lang.String reference)
Association
object.
reference
- a SIdRef string to be set.
public int unsetReference()
Association
object.
public int addGene(java.lang.String id)
id
to the association.
id
- the gene name.
public long getNumAssociations()
Association
object.
public int addAssociation(Association association)
Association
to this Association
object.
association
- the Association
object to add.
public int removeAssociation(int index)
index
from this
Association
object.
index
- the index number of the item to remove.
public int clearAssociations()
Association
object.
public Association createAnd()
Association
of type 'and'.
This method does not actually add the created Association
as a child of
this Association
object or do anything else with it&mdashthe returning
pointer is now owned by the caller.
public Association createOr()
Association
of type 'or'.
This method does not actually add the created Association
as a child of
this Association
object or do anything else with it&mdashthe returning
pointer is now owned by the caller.
public Association createGene(java.lang.String reference)
Association
of type 'and' with a given gene reference.
This method does not actually add the created Association
as a child of
this Association
object or do anything else with it&mdashthe returning
pointer is now owned by the caller.
reference
- the gene reference, as a string.
Association
object.public Association createGene()
Association
of type 'and' with a given gene reference.
This method does not actually add the created Association
as a child of
this Association
object or do anything else with it&mdashthe returning
pointer is now owned by the caller.
reference
- the gene reference, as a string.
Association
object.public XMLNode toXML()
XMLNode
object from this Association
object.public java.lang.String getElementName()
getElementName
 in class SBase
public Association cloneObject()
Association
object.
cloneObject
 in class SBase
Association
object.public int getTypeCode()
LibSBML attaches an identifying code to every kind of SBML object. These
are integer constants known as SBML type codes. The names of all
the codes begin with the characters SBML_
.
In the Java language interface for libSBML, the
type codes are defined as static integer constants in the interface class
libsbmlConstants
. Note that different Level 3
package plug-ins may use overlapping type codes to identify the package
to which a given object belongs, call the getPackageName()
method on the object.
getTypeCode
 in class SBase
SBML_FBC_ASSOCIATION
.
Association.getElementName()
,
SBase.getPackageName()
public static Association parseInfixAssociation(java.lang.String association)
Association
object.
This parses a string that has a list of gene names and conjunctions or disjunctions. For example:
(b2422) and (b2425) and (b2423) and (b2424) or (b2422) and (b2423) and (b2424) and (b2413) and (b3917)
association
- the string to parse.
null
in case of an error.
Association.toInfix()
public java.lang.String toInfix()
Association
object into an infix string representation.
The format is the same as is found in parseInfixAssociation().
Association.parseInfixAssociation(String association)