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 Details

    • value

      private java.lang.String value
    • type

      private AnnotationType type
    • xref

      private org.bridgedb.Xref xref
    • annotationRefs

      private java.util.List<PathwayElement.AnnotationRef> 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

      public ObjectType getObjectType()
      Returns the object type of this pathway element.
      Specified by:
      getObjectType in class PathwayObject
      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

      public AnnotationType getType()
      Returns the type of this annotation.
      Returns:
      type the type of this annotation, e.g. ontology term.
    • setType

      protected void setType​(AnnotationType v)
      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

      public java.util.List<PathwayElement.AnnotationRef> getAnnotationRefs()
      Returns the list of annotationRefs which reference the annotation.
      Returns:
      annotationRefs the list of pathway elements which reference the annotation.
    • hasAnnotationRef

      public boolean hasAnnotationRef​(PathwayElement.AnnotationRef annotationRef)
      Check whether annotationRefs has the given annotationRef.
      Parameters:
      annotationRef - the annotationRef to look for.
      Returns:
      true if has annotationRef, false otherwise.
    • addAnnotationRef

      protected void addAnnotationRef​(PathwayElement.AnnotationRef annotationRef)
      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

      protected void removeAnnotationRef​(PathwayElement.AnnotationRef annotationRef)
      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 class PathwayObject
    • equalsAnnotation

      public boolean equalsAnnotation​(Annotation annotation)
      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

      public void copyValuesFrom​(Annotation src)
      Copies values from the given source pathway element.

      NB:

      1. 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

      public Annotation copyRef()
      Copies this annotation.
      Returns:
      the new annotation copied from this annotation.