org.sbml.jsbml
public class Annotation extends AnnotationElement
SBase
element. It
contains the list of CVTerm
objects, a Map
containing an XML
name space and a String
containing all the annotation elements of
this name space.Modifier and Type | Field and Description |
---|---|
private java.lang.String |
about
matches the about XML attribute of an annotation element in a SBML
file.
|
private History |
history
The ModelHistory which represents the history section of a RDF
annotation
|
private java.util.List<CVTerm> |
listOfCVTerms
contains all the CVTerm of the RDF annotation
|
private XMLNode |
nonRDFannotation
contains all the remaining annotation not mapped to Objects.
|
private static long |
serialVersionUID
Generated serial version identifier.
|
static java.lang.String |
URI_RDF_SYNTAX_NS
The RDF syntax name space definition URI.
|
listOfListeners, parent, UNKNOWN_ATTRIBUTES, UNKNOWN_ELEMENTS
Constructor and Description |
---|
Annotation()
Creates an Annotation instance.
|
Annotation(Annotation annotation)
Creates a new Annotation instance by cloning the given Annotation.
|
Annotation(java.util.List<CVTerm> cvTerms)
Creates an
Annotation instance from a list of CVTerm
objects. |
Annotation(java.lang.String annotation)
Creates an
Annotation instance from a String containing non RDF
annotation. |
Annotation(java.lang.String annotation,
java.util.List<CVTerm> cvTerms)
|
Modifier and Type | Method and Description |
---|---|
boolean |
addCVTerm(CVTerm cvTerm)
Adds a
CVTerm . |
void |
addDeclaredNamespace(java.lang.String prefix,
java.lang.String uri)
Adds an additional namespace to the set of declared namespaces of this
SBase . |
void |
appendNoRDFAnnotation(java.lang.String annotation)
Appends some 'annotation' to the non RDF annotation
XMLNode of this object. |
Annotation |
clone() |
private History |
createHistory() |
boolean |
equals(java.lang.Object object) |
java.util.List<CVTerm> |
filterCVTerms(CVTerm.Qualifier qualifier)
Returns a list of CVTerm having the given qualifier.
|
java.util.List<java.lang.String> |
filterCVTerms(CVTerm.Qualifier qualifier,
java.lang.String pattern)
Returns a list of CVTerm having the given qualifier and
where the URI contains the given pattern.
|
java.lang.String |
getAbout()
Returns the about String of this object.
|
boolean |
getAllowsChildren() |
XMLNode |
getAnnotationBuilder()
Deprecated.
|
javax.swing.tree.TreeNode |
getChildAt(int childIndex) |
int |
getChildCount() |
CVTerm |
getCVTerm(int i)
Returns the CVTerm at the ith position in the list of CVTerms.
|
int |
getCVTermCount()
Gives the number of
CVTerm s in this Annotation . |
XMLNamespaces |
getDeclaredNamespaces() |
static java.lang.String |
getElementNameEquivalentToQualifier(CVTerm.Qualifier qualifier)
Returns a
String which represents the given CVTerm.Qualifier . |
XMLNode |
getFullAnnotation() |
java.lang.String |
getFullAnnotationString() |
History |
getHistory()
Returns the
History of the Annotation. |
java.util.List<CVTerm> |
getListOfCVTerms()
Returns the list of CVTerms.
|
XMLNode |
getNonRDFannotation()
Returns the
XMLNode containing annotations other than
the official RDF annotation, as defined in the SBML specifications. |
java.lang.String |
getNonRDFannotationAsString()
Returns the String containing annotations other than RDF
annotation.
|
int |
getNumCVTerms()
Gives the number of
CVTerm s in this Annotation . |
int |
hashCode() |
boolean |
isEmpty() |
boolean |
isSetAbout()
Checks whether the 'about' element has been initialized.
|
boolean |
isSetAnnotation()
Checks if the
Annotation is initialized. |
boolean |
isSetHistory()
Checks if the
History is initialized |
boolean |
isSetListOfCVTerms()
Checks if the list of
CVTerm is not empty. |
boolean |
isSetNonRDFannotation()
Checks if the non RDF part of the Annotation is initialized.
|
boolean |
isSetOtherAnnotationThanRDF()
Deprecated.
please use
isSetNonRDFannotation() |
boolean |
isSetRDFannotation()
Checks if the RDF part of the Annotation is initialized.
|
boolean |
readAttribute(java.lang.String attributeName,
java.lang.String prefix,
java.lang.String value)
Sets the about instance of this object if the attributeName is equal to
'about'.
|
void |
setAbout(java.lang.String about)
Sets the value of the about String of this object.
|
void |
setHistory(History history)
Changes the
History instance to 'history' |
void |
setNonRDFAnnotation(java.lang.String nonRDFAnnotationStr)
Sets the value of the non RDF annotations
|
void |
setNonRDFAnnotation(XMLNode nonRDFAnnotation)
Sets the value of the non RDF annotations
|
void |
unsetCVTerms()
|
void |
unsetHistory()
Sets the
History instance of this object to null . |
void |
unsetNonRDFannotation()
Sets the non RDF annotation String to
null . |
addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, children, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getParent, getRoot, getTreeNodeChangeListenerCount, getUserObject, indexOf, isLeaf, isRoot, isSetParent, isSetUserObjects, notifyChildChange, putUserObject, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, setParent, toString, userObjectKeySet
private static final long serialVersionUID
public static final transient java.lang.String URI_RDF_SYNTAX_NS
private java.lang.String about
private History history
private java.util.List<CVTerm> listOfCVTerms
private XMLNode nonRDFannotation
public Annotation()
public Annotation(Annotation annotation)
annotation
- the annotation to be cloned.public Annotation(java.util.List<CVTerm> cvTerms)
Annotation
instance from a list of CVTerm
objects. By default, the History
and otherAnnotation String
s are
null
. The Map
extensions is empty.cvTerms
- the list of CVTerm
.public Annotation(java.lang.String annotation) throws javax.xml.stream.XMLStreamException
Annotation
instance from a String
containing non RDF
annotation. By default, the History
is null, the list of CVTerm
s
is empty. The Map
extensions is empty.annotation
- a String
containing non RDF annotation, it will be parsed to
create a Map
containing an XML name space associated with a
String
representing all the annotation elements of
this name space.javax.xml.stream.XMLStreamException
public Annotation(java.lang.String annotation, java.util.List<CVTerm> cvTerms) throws javax.xml.stream.XMLStreamException
Annotation
instance from a String
containing
non RDF annotation and a list of CVTerm
. By default, the
History
is null
. The Map
extensions is empty.annotation
- a String
containing non RDF annotation, it will be
parsed to create a Map
containing an XML name space
associated with a String
representing all the
annotation elements of this name space.cvTerms
- the List
of CVTerm
.javax.xml.stream.XMLStreamException
public static java.lang.String getElementNameEquivalentToQualifier(CVTerm.Qualifier qualifier)
String
which represents the given CVTerm.Qualifier
.qualifier
- a Qualifier
String
which represents the given CVTerm.Qualifier
.public boolean addCVTerm(CVTerm cvTerm)
CVTerm
.cvTerm
- the CVTerm
to add.true
if the 'cvTerm' element has been added to the List
of CVTerm.Qualifier
s.public void appendNoRDFAnnotation(java.lang.String annotation) throws javax.xml.stream.XMLStreamException
XMLNode
of this object.annotation
- some non RDF annotations.javax.xml.stream.XMLStreamException
public Annotation clone()
clone
in class AbstractTreeNode
public boolean equals(java.lang.Object object)
equals
in class AbstractTreeNode
public java.util.List<CVTerm> filterCVTerms(CVTerm.Qualifier qualifier)
qualifier
- the qualifierpublic java.util.List<java.lang.String> filterCVTerms(CVTerm.Qualifier qualifier, java.lang.String pattern)
qualifier
- the qualifier.pattern
- a plain text pattern.public java.lang.String getAbout()
public boolean getAllowsChildren()
public XMLNode getAnnotationBuilder()
XMLNode
representing non RDF annotations.XMLNode
representing non RDF annotations.public XMLNode getFullAnnotation()
public java.lang.String getFullAnnotationString()
public javax.swing.tree.TreeNode getChildAt(int childIndex)
public int getChildCount()
public CVTerm getCVTerm(int i)
i
- the index of the CVTerm to retrieve.public History getHistory()
History
of the Annotation.History
of the Annotation.private History createHistory()
public java.util.List<CVTerm> getListOfCVTerms()
public java.lang.String getNonRDFannotationAsString()
public XMLNode getNonRDFannotation()
XMLNode
containing annotations other than
the official RDF annotation, as defined in the SBML specifications.XMLNode
containing annotations other than RDF
annotation. Return null if there are none.public int getNumCVTerms()
CVTerm
s in this Annotation
.Annotation
.public int getCVTermCount()
CVTerm
s in this Annotation
.Annotation
.public int hashCode()
hashCode
in class AbstractTreeNode
public boolean isEmpty()
public boolean isSetAbout()
true
if the 'about' element has been initialized.public boolean isSetAnnotation()
Annotation
is initialized.
An Annotation
is initialized if
at least one of the following is true:
CVTerm
are defined
true
if the Annotation is initializedpublic boolean isSetHistory()
History
is initializedtrue
if the History
is initializedpublic boolean isSetListOfCVTerms()
CVTerm
is not empty.true
if there is one or more CVTerm
defined.public boolean isSetNonRDFannotation()
An Annotation is initialized if there is some non RDF annotation
true
if the non RDF part of the Annotation is initialized.@Deprecated public boolean isSetOtherAnnotationThanRDF()
isSetNonRDFannotation()
true
if there is some non RDF annotation.
Same as isSetNonRDFannotation()
true
if there is some non RDF annotation.isSetNonRDFannotation()
public boolean isSetRDFannotation()
An Annotation is initialized if at least one of the following is true:
true
if the RDF part of the Annotation is initializedpublic boolean readAttribute(java.lang.String attributeName, java.lang.String prefix, java.lang.String value)
attributeName
- the attribute name.prefix
- the attribute prefix.value
- the attribute value.true
if an about XML attribute has been readpublic void setAbout(java.lang.String about)
about
- the about String to set.public void setHistory(History history)
History
instance to 'history'history
- the history to set.public void setNonRDFAnnotation(XMLNode nonRDFAnnotation)
nonRDFAnnotation
- public void setNonRDFAnnotation(java.lang.String nonRDFAnnotationStr) throws javax.xml.stream.XMLStreamException
nonRDFAnnotation
- javax.xml.stream.XMLStreamException
public void unsetCVTerms()
public void unsetHistory()
History
instance of this object to null
.public void unsetNonRDFannotation()
null
.public void addDeclaredNamespace(java.lang.String prefix, java.lang.String uri)
SBase
.prefix
- the prefix of the namespace to addnamespace
- the namespace to addpublic XMLNamespaces getDeclaredNamespaces()