Package org.pathvisio.libgpml.model
Class Annotation
java.lang.Object
org.pathvisio.libgpml.model.PathwayObject
org.pathvisio.libgpml.model.Annotation
public class Annotation extends PathwayObject
This class stores information for an Annotation.
- Author:
- finterly
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<PathwayElement.AnnotationRef>
annotationRefs
private AnnotationType
type
private java.lang.String
urlLink
private java.lang.String
value
private org.bridgedb.Xref
xref
Fields inherited from class org.pathvisio.libgpml.model.PathwayObject
noFire, pathwayModel
-
Constructor Summary
Constructors Modifier Constructor Description protected
Annotation(java.lang.String value, AnnotationType type, org.bridgedb.Xref xref, java.lang.String urlLink)
Instantiates an Annotation pathway element given all possible parameters: elementId, parent pathway model, value, type, url, and xref. -
Method Summary
Modifier and Type Method Description protected void
addAnnotationRef(PathwayElement.AnnotationRef annotationRef)
Adds the given annotationRef to annotationRefs list of the annotation.Annotation
copyRef()
Copies this annotation.void
copyValuesFrom(Annotation src)
Copies values from the given source pathway element.boolean
equalsAnnotation(Annotation annotation)
Compares this annotation to the given annotation.java.util.List<PathwayElement.AnnotationRef>
getAnnotationRefs()
Returns the list of annotationRefs which reference the annotation.ObjectType
getObjectType()
Returns the object type of this pathway element.AnnotationType
getType()
Returns the type of this annotation.java.lang.String
getUrlLink()
Returns the url link for a web address.java.lang.String
getValue()
Returns the name, term, or text of this annotation.org.bridgedb.Xref
getXref()
Returns the Annotation Xref.boolean
hasAnnotationRef(PathwayElement.AnnotationRef annotationRef)
Check whether annotationRefs has the given annotationRef.protected void
removeAnnotationRef(PathwayElement.AnnotationRef annotationRef)
Removes the given annotationRef from annotationRefs list of this annotation.private void
removeAnnotationRefs()
Removes all annotationRefs from annotationRefs list.protected void
setType(AnnotationType v)
Sets the type of this annotation.protected void
setUrlLink(java.lang.String v)
Sets the url link for a web address.protected void
setValue(java.lang.String v)
Sets the name, term, or text of this annotation.protected void
setXref(org.bridgedb.Xref v)
Sets the Xref for this annotation.protected void
terminate()
Terminates this annotation.Methods inherited from class org.pathvisio.libgpml.model.PathwayObject
addListener, dontFireEvents, fireObjectModifiedEvent, getElementId, getListeners, getPathwayModel, getPropertyEx, getPropertyKeys, getStaticProperty, getStaticPropertyKeys, hasPathwayModel, removeListener, setElementId, setGeneratedElementId, setPathwayModel, setPathwayModelTo, setPropertyEx, setStaticProperty, unsetPathwayModel
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
value
private java.lang.String value -
type
-
xref
private org.bridgedb.Xref xref -
urlLink
private java.lang.String urlLink -
annotationRefs
-
-
Constructor Details
-
Annotation
protected Annotation(java.lang.String value, AnnotationType type, org.bridgedb.Xref xref, java.lang.String urlLink)Instantiates an Annotation pathway element given all possible parameters: elementId, parent pathway model, value, type, url, and xref.- Parameters:
value
- the name, term, or text of the annotation.type
- the type of the annotation, e.g. ontology.xref
- the annotation xref.urlLink
- the url link of the annotation.
-
-
Method Details
-
getObjectType
Returns the object type of this pathway element.- Specified by:
getObjectType
in classPathwayObject
- Returns:
- the object type.
-
getValue
public java.lang.String getValue()Returns the name, term, or text of this annotation.- Returns:
- value the name, term, or text of this annotation.
-
setValue
protected void setValue(java.lang.String v)Sets the name, term, or text of this annotation.- Parameters:
v
- the name, term, or text of this annotation.
-
getType
Returns the type of this annotation.- Returns:
- type the type of this annotation, e.g. ontology term.
-
setType
Sets the type of this annotation.- Parameters:
v
- the type to set for this annotation, e.g. ontology term.
-
getXref
public org.bridgedb.Xref getXref()Returns the Annotation Xref.- Returns:
- xref the annotation xref.
-
setXref
protected void setXref(org.bridgedb.Xref v)Sets the Xref for this annotation.- Parameters:
v
- the xref to set for this annotation.
-
getUrlLink
public java.lang.String getUrlLink()Returns the url link for a web address.- Returns:
- urlLink the url link.
-
setUrlLink
protected void setUrlLink(java.lang.String v)Sets the url link for a web address.- Parameters:
v
- the url link.
-
getAnnotationRefs
Returns the list of annotationRefs which reference the annotation.- Returns:
- annotationRefs the list of pathway elements which reference the annotation.
-
hasAnnotationRef
Check whether annotationRefs has the given annotationRef.- Parameters:
annotationRef
- the annotationRef to look for.- Returns:
- true if has annotationRef, false otherwise.
-
addAnnotationRef
Adds the given annotationRef to annotationRefs list of the annotation. NB: This method is not used directly.- Parameters:
annotationRef
- the given annotationRef to add.
-
removeAnnotationRef
Removes the given annotationRef from annotationRefs list of this annotation. If annotationRefs becomes empty, this annotation is removed from the pathway model because it is no longer referenced/used. NB: This method is not used directly.- Parameters:
annotationRef
- the given annotationRef to remove.
-
removeAnnotationRefs
private void removeAnnotationRefs()Removes all annotationRefs from annotationRefs list. -
terminate
protected void terminate()Terminates this annotation. The pathway model, if any, is unset from this annotation. Links to all annotationRefs are removed from this annotation.- Overrides:
terminate
in classPathwayObject
-
equalsAnnotation
Compares this annotation to the given annotation. Checks all properties except annotationsRefs list to determine whether they are equal.- Parameters:
annotation
- the annotation to compare to.- Returns:
- true if annotations have equal properties, false otherwise.
-
copyValuesFrom
Copies values from the given source pathway element.NB:
- annotationRefs list is not copied, annotationRefs are created and added when an annotation is added to a pathway element.
- Parameters:
src
- the source pathway element.
-
copyRef
Copies this annotation.- Returns:
- the new annotation copied from this annotation.
-