Class PathwayElement.CitationRef

java.lang.Object
org.pathvisio.libgpml.model.PathwayElement.InfoRef
org.pathvisio.libgpml.model.PathwayElement.CitationRef
All Implemented Interfaces:
Referenceable, Referenceable.Annotatable
Enclosing class:
PathwayElement

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

  • Constructor Details

    • CitationRef

      protected CitationRef​(Citation citation)
      Instantiates an CitationRef given source Citation and initializes annotationRefs lists.
      Parameters:
      citation - the source citation this CitationRef refers to.
  • Method Details

    • getCitation

      public Citation getCitation()
      Returns the citation referenced.
      Returns:
      citation the citation referenced.
    • hasCitation

      public boolean hasCitation()
      Checks whether this citationRef has a source citation.
      Returns:
      true if and only if the citation of this citationRef is effective.
    • setCitationTo

      public void setCitationTo​(Citation citation)
      Sets the source citation for this citationRef. Adds this citationRef to the source citation.
      Parameters:
      citation - the given source citation to set.
    • setCitation

      private void setCitation​(Citation v)
      Sets the source citation for this citationRef.
      Parameters:
      v - the given source citation to set.
    • unsetCitation

      public void unsetCitation()
      Unsets the citation, if any, from this citationRef. Removes this citationRef from the source citation.
    • getCitable

      public Referenceable.Citable getCitable()
      Returns the target pathway, pathway element, or annotationRef Referenceable.Citable for this citationRef.
      Returns:
      citable the target of the citationRef.
    • hasCitable

      public boolean hasCitable()
      Checks whether this citationRef has a target citable.
      Returns:
      true if and only if the citable of this citationRef is effective.
    • setCitableTo

      protected void setCitableTo​(Referenceable.Citable citable)
      Sets the target pathway, pathway element, or annotationRef Referenceable.Citable for this annotationRef. NB: Citable is only set when an Citable adds a CitationRef. This method is not used directly.
      Parameters:
      citable - the given target citable to set.
    • setCitable

      private void setCitable​(Referenceable.Citable v)
      Sets the target pathway, pathway element, or annotationRef Referenceable.Citable to which the annotationRef belongs.
      Parameters:
      v - the given target citable to set.
    • unsetCitable

      protected void unsetCitable()
      Unsets the citable, if any, from this citationRef. NB: This method is not used directly.
    • getAnnotationRefs

      public java.util.List<PathwayElement.AnnotationRef> getAnnotationRefs()
      Returns the list of annotation references.
      Specified by:
      getAnnotationRefs in interface Referenceable.Annotatable
      Returns:
      annotationRefs the list of annotations referenced, an empty list if no properties are defined.
    • hasAnnotationRef

      public boolean hasAnnotationRef​(PathwayElement.AnnotationRef annotationRef)
      Checks whether annotationRefs has the given annotationRef.
      Specified by:
      hasAnnotationRef in interface Referenceable.Annotatable
      Parameters:
      annotationRef - the annotationRef to look for.
      Returns:
      true if has annotationRef, false otherwise.
    • addAnnotation

      public PathwayElement.AnnotationRef addAnnotation​(Annotation annotation)
      Creates and adds an annotationRef to annotationRefs list.Sets annotable for the given annotationRef.
      Specified by:
      addAnnotation in interface Referenceable.Annotatable
      Parameters:
      annotation - the annotation for annotationRef.
      Returns:
      the annotationRef of added annotation.
    • addAnnotation

      public PathwayElement.AnnotationRef addAnnotation​(java.lang.String value, AnnotationType type, org.bridgedb.Xref xref, java.lang.String urlLink)
      Creates a annotation with given properties, and adds annotation to pathway model. Creates a annotationRef for annotation, and adds to annotationRefs list for this annotatable. Calls addAnnotation(Annotation annotation).
      Specified by:
      addAnnotation in interface Referenceable.Annotatable
      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.
      Returns:
      the annotationRef of added annotation.
    • addAnnotation

      public PathwayElement.AnnotationRef addAnnotation​(java.lang.String elementId, java.lang.String value, AnnotationType type, org.bridgedb.Xref xref, java.lang.String urlLink)
      Creates a annotation with given properties, and adds annotation to pathway model. Creates a annotationRef for annotation, and adds to annotationRefs list for this annotatable. Sets elementId for annotation. This method is used when reading gpml. Calls addAnnotation(Annotation annotation).
      Specified by:
      addAnnotation in interface Referenceable.Annotatable
      Parameters:
      elementId - the elementId to set.
      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.
      Returns:
      the annotationRef of added annotation.
    • removeAnnotationRef

      public void removeAnnotationRef​(PathwayElement.AnnotationRef annotationRef)
      Removes given annotationRef from annotationRefs list. The annotationRef ceases to exist and is terminated.
      Specified by:
      removeAnnotationRef in interface Referenceable.Annotatable
      Parameters:
      annotationRef - the annotationRef to be removed.
    • removeAnnotationRefs

      public void removeAnnotationRefs()
      Removes all annotationRefs from annotationRefs list.
      Specified by:
      removeAnnotationRefs in interface Referenceable.Annotatable
    • terminate

      protected void terminate()
      Terminates this citationRef. The citation and citable, if any, are unset from this citationRef. Links to all annotationRefs are removed from this citationRef.
    • toString

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