Class PathwayElement.AnnotationRef

java.lang.Object
org.pathvisio.libgpml.model.PathwayElement.InfoRef
org.pathvisio.libgpml.model.PathwayElement.AnnotationRef
All Implemented Interfaces:
Referenceable, Referenceable.Citable, Referenceable.Evidenceable
Enclosing class:
PathwayElement

public class PathwayElement.AnnotationRef
extends PathwayElement.InfoRef
implements Referenceable.Citable, Referenceable.Evidenceable
This class stores information for an AnnotationRef with source Annotation, target Referenceable.Annotatable, and a list of PathwayElement.CitationRef and/or PathwayElement.EvidenceRef. The Annotatable target can be a PathwayElement, or PathwayElement.CitationRef. In gpml:AnnotationRef, the attribute elementRef refers to the elementId of the source gpml:Annotation.
Author:
finterly
  • Field Details

  • Constructor Details

    • AnnotationRef

      public AnnotationRef​(Annotation annotation)
      Instantiates an AnnotationRef given source Annotation and initializes citationRefs and evidenceRefs lists.
      Parameters:
      annotation - the source annotation this AnnotationRef refers to.
  • Method Details

    • getAnnotation

      public Annotation getAnnotation()
      Returns the annotation referenced.
      Returns:
      annotation the annotation referenced.
    • hasAnnotation

      public boolean hasAnnotation()
      Checks whether this annotationRef has a source annotation.
      Returns:
      true if and only if the annotation of this annotationRef is effective.
    • setAnnotationTo

      public void setAnnotationTo​(Annotation annotation)
      Sets the source annotation for this annotationRef. Adds this annotationRef to the source annotation.
      Parameters:
      annotation - the given source annotation to set.
    • setAnnotation

      private void setAnnotation​(Annotation v)
      Sets the source annotation for this annotationRef.
      Parameters:
      v - the given source annotation to set.
    • unsetAnnotation

      protected void unsetAnnotation()
      Unsets the annotation, if any, from this annotationRef. Removes this annotationRef from the source annotation.
    • getAnnotatable

      public Referenceable.Annotatable getAnnotatable()
      Returns the target pathway, pathway element, or citationRef Referenceable.Annotatable for this annotationRef.
      Returns:
      annotatable the target of the annotationRef.
    • hasAnnotatable

      public boolean hasAnnotatable()
      Checks whether this annotationRef has a target annotatable.
      Returns:
      true if and only if the annotatable of this annotationRef is effective.
    • setAnnotatableTo

      protected void setAnnotatableTo​(Referenceable.Annotatable annotatable)
      Sets the target pathway element or citationRef Referenceable.Annotatable for this annotationRef. NB: Annotatable is only set when an Annotatable adds an AnnotationRef. This method is not used directly.
      Parameters:
      annotatable - the given target annotatable to set.
    • setAnnotatable

      private void setAnnotatable​(Referenceable.Annotatable v)
      Sets the target pathway, pathway element, or citationRef Referenceable.Annotatable for this annotationRef.
      Parameters:
      v - the given target annotatable to set.
    • unsetAnnotatable

      protected void unsetAnnotatable()
      Unsets the annotatable, if any, from this annotationRef. NB: This method is not used directly.
    • getCitationRefs

      public java.util.List<PathwayElement.CitationRef> getCitationRefs()
      Returns the list of citation references.
      Specified by:
      getCitationRefs in interface Referenceable.Citable
      Returns:
      citationRefs the list of citations referenced, an empty list if no properties are defined.
    • hasCitationRef

      public boolean hasCitationRef​(PathwayElement.CitationRef citationRef)
      Checks whether citationRefs has the given citationRef.
      Specified by:
      hasCitationRef in interface Referenceable.Citable
      Parameters:
      citationRef - the citationRef to look for.
      Returns:
      true if has citationRef, false otherwise.
    • addCitation

      public PathwayElement.CitationRef addCitation​(Citation citation)
      Creates and adds an citationRef to citationRefs list. Sets citable for the given citationRef.
      Specified by:
      addCitation in interface Referenceable.Citable
      Parameters:
      citation - the citation for citationRef.
      Returns:
      the citationRef of added citation.
    • addCitation

      public PathwayElement.CitationRef addCitation​(org.bridgedb.Xref xref, java.lang.String urlLink)
      Creates a citation with given xref and urlLink, and adds citation to pathway model. Creates a citationRef for citation, and adds to citationRefs list for this citable.
      Specified by:
      addCitation in interface Referenceable.Citable
      Parameters:
      xref - the citation xref.
      urlLink - the url link and description (optional) for a web address.
      Returns:
      the citationRef of added citation.
    • addCitation

      public PathwayElement.CitationRef addCitation​(java.lang.String elementId, org.bridgedb.Xref xref, java.lang.String urlLink)
      Creates a citation with given xref and urlLink, and adds citation to pathway model. Creates a citationRef for citation, and adds to citationRefs list for this citable. Sets elementId for citation. This method is used when reading gpml. Calls addCitation(Citation citation).
      Specified by:
      addCitation in interface Referenceable.Citable
      Parameters:
      elementId - the elementId to set.
      xref - the citation xref.
      urlLink - the url link and description (optional) for a web address.
      Returns:
      the citationRef of added citation.
    • removeCitationRef

      public void removeCitationRef​(PathwayElement.CitationRef citationRef)
      Removes given citationRef from citationRefs list. The citationRef ceases to exist and is terminated.
      Specified by:
      removeCitationRef in interface Referenceable.Citable
      Parameters:
      citationRef - the citationRef to be removed.
    • removeCitationRefs

      public void removeCitationRefs()
      Removes all citationRef from citationRefs list.
      Specified by:
      removeCitationRefs in interface Referenceable.Citable
    • getEvidenceRefs

      public java.util.List<PathwayElement.EvidenceRef> getEvidenceRefs()
      Returns the list of evidence references.
      Specified by:
      getEvidenceRefs in interface Referenceable.Evidenceable
      Returns:
      evidenceRefs the list of evidences referenced, an empty list if no properties are defined.
    • hasEvidenceRef

      public boolean hasEvidenceRef​(PathwayElement.EvidenceRef evidenceRef)
      Checks whether citationRefs has the given citationRef.
      Specified by:
      hasEvidenceRef in interface Referenceable.Evidenceable
      Parameters:
      evidenceRef - the evidenceRef to look for.
      Returns:
      true if has evidenceRef, false otherwise.
    • addEvidence

      public PathwayElement.EvidenceRef addEvidence​(Evidence evidence)
      Creates and adds an evidenceRef to evidenceRefs list. Sets evidenceable for the given evidenceRef.
      Specified by:
      addEvidence in interface Referenceable.Evidenceable
      Parameters:
      evidence - the evidence for evidenceRef.
      Returns:
      the evidencRef of added evidence.
    • addEvidence

      public PathwayElement.EvidenceRef addEvidence​(java.lang.String value, org.bridgedb.Xref xref, java.lang.String urlLink)
      Creates an evidence with given properties, and adds evidence to pathway model. Creates a evidenceRef for evidence, and adds to evidenceRefs list for this evidenceable. Calls addEvidence(Evidence evidence).
      Specified by:
      addEvidence in interface Referenceable.Evidenceable
      Parameters:
      value - the name, term, or text of the evidence.
      xref - the evidence xref.
      urlLink - the url link and description (optional) for a web address.
      Returns:
      the evidencRef of added evidence.
    • addEvidence

      public PathwayElement.EvidenceRef addEvidence​(java.lang.String elementId, java.lang.String value, org.bridgedb.Xref xref, java.lang.String urlLink)
      Creates an evidence with given properties, and adds evidence to pathway model. Creates a evidenceRef for evidence, and adds to evidenceRefs list for this evidenceable. Sets elementId for evidence. This method is used when reading gpml. Calls addEvidence(Evidence evidence).
      Specified by:
      addEvidence in interface Referenceable.Evidenceable
      Parameters:
      elementId - the elementId to set.
      value - the name, term, or text of the evidence.
      xref - the evidence xref.
      urlLink - the url link and description (optional) for a web address.
      Returns:
      the evidencRef of added evidence.
    • removeEvidenceRef

      public void removeEvidenceRef​(PathwayElement.EvidenceRef evidenceRef)
      Removes given evidenceRef from evidenceRefs list. The evidenceRef ceases to exist and is terminated.
      Specified by:
      removeEvidenceRef in interface Referenceable.Evidenceable
      Parameters:
      evidenceRef - the evidenceRef to be removed.
    • removeEvidenceRefs

      public void removeEvidenceRefs()
      Removes all evidenceRefs from evidenceRefs list.
      Specified by:
      removeEvidenceRefs in interface Referenceable.Evidenceable
    • terminate

      protected void terminate()
      Terminates this annotationRef. The annotation and annotatable, if any, are unset from this annotationRef.
    • toString

      public java.lang.String toString()
      Writes annotationRef out as a string.
      Overrides:
      toString in class java.lang.Object