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 java.util.Map<java.lang.String,java.lang.String> |
annotationNamespaces
contains all the name spaces of the matching XML annotation node
|
private java.util.Map<java.lang.String,Annotation> |
extensions
contains all the annotation extension objects with the name space of
their package.
|
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 java.lang.StringBuilder |
nonRDFannotation
contains all the annotation information which are not RDF.
|
private java.util.Map<java.lang.String,java.lang.String> |
rdfAnnotationNamespaces
contains all the name spaces of the matching XML RDF annotation node
|
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
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.util.Map<java.lang.String,java.lang.String> annotations)
Creates an
Annotation instance from a given Map of
annotations. |
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 |
---|---|
void |
addAnnotationNamespace(java.lang.String namespaceName,
java.lang.String prefix,
java.lang.String URI)
Adds a namespace to the map annotationNamespace of this object.
|
boolean |
addCVTerm(CVTerm cvTerm)
Adds a
CVTerm and checks whether the required name spaces have
already been added to the rdfAnnotationNamespaces . |
void |
addExtension(java.lang.String namespace,
Annotation annotation)
Adds an Annotation extension object to the extensions map of this object.
|
void |
addRDFAnnotationNamespace(java.lang.String namespaceName,
java.lang.String prefix,
java.lang.String URI)
Adds a name space to the rdfAnnotationNamespaces
Map of this
object. |
void |
appendNoRDFAnnotation(java.lang.String annotation)
Appends some'annotation' to the non RDF annotation StringBuilder of this object.
|
Annotation |
clone() |
private static void |
copy(java.util.Map<java.lang.String,java.lang.String> origin,
java.util.Map<java.lang.String,java.lang.String> target)
Copies one
Map instance into another. |
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() |
java.lang.StringBuilder |
getAnnotationBuilder()
Returns the StringBuilder representing non RDF annotations.
|
java.util.Map<java.lang.String,java.lang.String> |
getAnnotationNamespaces()
Returns the annotationNamespace map of this object.
|
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.
|
static java.lang.String |
getElementNameEquivalentToQualifier(CVTerm.Qualifier qualifier)
Returns a
String which represents the given CVTerm.Qualifier . |
Annotation |
getExtension(java.lang.String namespace)
Returns the Annotation extension object matching 'namespace'.
|
History |
getHistory()
Returns the
History of the Annotation. |
java.util.List<CVTerm> |
getListOfCVTerms()
Returns the list of CVTerms.
|
java.util.Set<java.lang.String> |
getNamespaces()
Returns the list of all the namespaces of all the packages which extend
this object.
|
java.lang.String |
getNonRDFannotation()
Returns the String containing annotations other than RDF
annotation.
|
int |
getNumCVTerms()
Gives the number of
CVTerm s in this Annotation . |
java.util.Map<java.lang.String,java.lang.String> |
getRDFAnnotationNamespaces()
Returns the rdfAnnotationNamespaces
Map of this object. |
int |
hashCode() |
void |
insertNoRDFAnnotation(java.lang.String annotation,
int offset)
Inserts 'annotation' to the non RDF annotation StringBuilder
at position 'offset'.
|
boolean |
isEmpty() |
boolean |
isSetAbout()
Checks whether the 'about' element has been initialized.
|
boolean |
isSetAnnotation()
Checks if the Annotation is initialised.
|
boolean |
isSetHistory()
Checks if the
History is initialised |
boolean |
isSetListOfCVTerms()
Checks if the list of
CVTerm is not empty. |
boolean |
isSetNonRDFannotation()
Checks if the non RDF part of the Annotation is initialised.
|
boolean |
isSetOtherAnnotationThanRDF()
Deprecated.
please use
isSetNonRDFannotation() |
boolean |
isSetRDFannotation()
Checks if the RDF part of the Annotation is initialised.
|
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 |
setAnnotationAttributes(org.w3c.dom.NamedNodeMap annotationNamespaces)
Sets the annotationNamespaces.
|
void |
setAnnotationNamespaces(java.util.Map<java.lang.String,java.lang.String> annotationNamespaces)
Sets the annotationNamespaces.
|
void |
setHistory(History history)
Changes the
History instance to 'history' |
void |
setNonRDFAnnotation(java.lang.String nonRDFAnnotation)
Sets the value of the non RDF annotations
|
void |
setRdfAnnotationNamespaces(java.util.Map<java.lang.String,java.lang.String> rdfAnnotationNamespaces)
Sets the rdfAnnotationNamespace map to 'rdfAnnotationNamespaces'.
|
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, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getParent, getTreeNodeChangeListenerCount, indexOf, isLeaf, isRoot, isSetParent, notifyChildChange, removeAllTreeNodeChangeListeners, removeTreeNodeChangeListener, removeTreeNodeChangeListener, setParent, toString
private static final long serialVersionUID
public static final transient java.lang.String URI_RDF_SYNTAX_NS
private java.lang.String about
private java.util.Map<java.lang.String,java.lang.String> annotationNamespaces
private java.util.Map<java.lang.String,Annotation> extensions
private History history
private java.util.List<CVTerm> listOfCVTerms
private java.lang.StringBuilder nonRDFannotation
private java.util.Map<java.lang.String,java.lang.String> rdfAnnotationNamespaces
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
s annotationNamespaces, rdfAnnotationNamespaces and
extensions are empty.cvTerms
- the list of CVTerm
.public Annotation(java.util.Map<java.lang.String,java.lang.String> annotations)
Annotation
instance from a given Map
of
annotations. By default, the History
and otherAnnotation String
s
are null. The list of CVTerm
s, rdfAnnotationNamespaces and
extensions are empty.annotations
- a map containing an XML name space and a String
containing all the annotation elements of this name space.public Annotation(java.lang.String annotation)
Annotation
instance from a String
containing non RDF
annotation. By default, the History
is null, the list of CVTerm
s
is empty. The Map
s annotationNamespaces, rdfAnnotationNamespaces
and extensions are 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.public Annotation(java.lang.String annotation, java.util.List<CVTerm> cvTerms)
Annotation
instance from a String
containing
non RDF annotation and a list of CVTerm
. By default, the
History
is null. The Map
s annotationNamespaces,
rdfAnnotationNamespaces and extensions are 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
.private static final void copy(java.util.Map<java.lang.String,java.lang.String> origin, java.util.Map<java.lang.String,java.lang.String> target)
Map
instance into another.origin
- copy from heretarget
- copy everything into this target Map
.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 void addAnnotationNamespace(java.lang.String namespaceName, java.lang.String prefix, java.lang.String URI)
namespaceName
- an XML namespace name.prefix
- an optional prefix for the namespace.URI
- the URI of the namespacepublic boolean addCVTerm(CVTerm cvTerm)
CVTerm
and checks whether the required name spaces have
already been added to the rdfAnnotationNamespaces
. If name
spaces are missing, these are added automatically.cvTerm
- the CVTerm
to add.List
of CVTerm.Qualifier
s.public void addExtension(java.lang.String namespace, Annotation annotation)
namespace
- the name space.annotation
- the annotation extension object.public void addRDFAnnotationNamespace(java.lang.String namespaceName, java.lang.String prefix, java.lang.String URI)
Map
of this
object.namespaceName
- the name space nameprefix
- the name space prefixURI
- the name space URIpublic void appendNoRDFAnnotation(java.lang.String annotation)
annotation
- some non RDF annotations.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 java.lang.StringBuilder getAnnotationBuilder()
public java.util.Map<java.lang.String,java.lang.String> getAnnotationNamespaces()
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 Annotation getExtension(java.lang.String namespace)
namespace
- the namespacepublic History getHistory()
History
of the Annotation.History
of the Annotation.private History createHistory()
public java.util.List<CVTerm> getListOfCVTerms()
public java.util.Set<java.lang.String> getNamespaces()
public java.lang.String getNonRDFannotation()
public int getNumCVTerms()
CVTerm
s in this Annotation
.Annotation
.public java.util.Map<java.lang.String,java.lang.String> getRDFAnnotationNamespaces()
Map
of this object.Map
of this object.public int hashCode()
hashCode
in class AbstractTreeNode
public void insertNoRDFAnnotation(java.lang.String annotation, int offset)
annotation
- the piece of annotation to add.offset
- the position where to add it in the StringBuilder.public boolean isEmpty()
public boolean isSetAbout()
public boolean isSetAnnotation()
An Annotation is initialised if at least one of the following is true :
public boolean isSetHistory()
History
is initialisedHistory
is initialisedpublic boolean isSetListOfCVTerms()
CVTerm
is not empty.CVTerm
defined.public boolean isSetNonRDFannotation()
An Annotation is initialised if there is some non RDF annotation
@Deprecated public boolean isSetOtherAnnotationThanRDF()
isSetNonRDFannotation()
Same as isSetNonRDFannotation()
isSetNonRDFannotation()
public boolean isSetRDFannotation()
An Annotation is initialised if at least one of the following is true :
public 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.public void setAbout(java.lang.String about)
about
- the about String to set.public void setAnnotationAttributes(org.w3c.dom.NamedNodeMap annotationNamespaces)
annotationNamespaces
- the annotationNamespaces to setpublic void setAnnotationNamespaces(java.util.Map<java.lang.String,java.lang.String> annotationNamespaces)
annotationNamespaces
- the annotationNamespaces to setpublic void setHistory(History history)
History
instance to 'history'history
- the history to set.public void setNonRDFAnnotation(java.lang.String nonRDFAnnotation)
nonRDFAnnotation
- public void setRdfAnnotationNamespaces(java.util.Map<java.lang.String,java.lang.String> rdfAnnotationNamespaces)
rdfAnnotationNamespaces
- the rdfAnnotationNamespace Map
to set.public void unsetCVTerms()
public void unsetHistory()
History
instance of this object to null.public void unsetNonRDFannotation()