Package org.pathvisio.libgpml.model
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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.pathvisio.libgpml.model.Referenceable
Referenceable.Annotatable, Referenceable.Citable, Referenceable.Evidenceable
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<PathwayElement.AnnotationRef>
annotationRefs
private Referenceable.Citable
citable
private Citation
citation
-
Constructor Summary
Constructors Modifier Constructor Description protected
CitationRef(Citation citation)
Instantiates an CitationRef given sourceCitation
and initializes annotationRefs lists. -
Method Summary
Modifier and Type Method Description 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.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.PathwayElement.AnnotationRef
addAnnotation(Annotation annotation)
Creates and adds an annotationRef to annotationRefs list.Sets annotable for the given annotationRef.java.util.List<PathwayElement.AnnotationRef>
getAnnotationRefs()
Returns the list of annotation references.Referenceable.Citable
getCitable()
Returns the target pathway, pathway element, or annotationRefReferenceable.Citable
for this citationRef.Citation
getCitation()
Returns the citation referenced.boolean
hasAnnotationRef(PathwayElement.AnnotationRef annotationRef)
Checks whether annotationRefs has the given annotationRef.boolean
hasCitable()
Checks whether this citationRef has a target citable.boolean
hasCitation()
Checks whether this citationRef has a source citation.void
removeAnnotationRef(PathwayElement.AnnotationRef annotationRef)
Removes given annotationRef from annotationRefs list.void
removeAnnotationRefs()
Removes all annotationRefs from annotationRefs list.private void
setCitable(Referenceable.Citable v)
Sets the target pathway, pathway element, or annotationRefReferenceable.Citable
to which the annotationRef belongs.protected void
setCitableTo(Referenceable.Citable citable)
Sets the target pathway, pathway element, or annotationRefReferenceable.Citable
for this annotationRef.private void
setCitation(Citation v)
Sets the source citation for this citationRef.void
setCitationTo(Citation citation)
Sets the source citation for this citationRef.protected void
terminate()
Terminates this citationRef.java.lang.String
toString()
Writes citationRef out as a string.protected void
unsetCitable()
Unsets the citable, if any, from this citationRef.void
unsetCitation()
Unsets the citation, if any, from this citationRef.Methods inherited from class org.pathvisio.libgpml.model.PathwayElement.InfoRef
getTopPathwayElement
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
citation
-
citable
-
annotationRefs
-
-
Constructor Details
-
CitationRef
Instantiates an CitationRef given sourceCitation
and initializes annotationRefs lists.- Parameters:
citation
- the source citation this CitationRef refers to.
-
-
Method Details
-
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
Sets the source citation for this citationRef. Adds this citationRef to the source citation.- Parameters:
citation
- the given source citation to set.
-
setCitation
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
Returns the target pathway, pathway element, or annotationRefReferenceable.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
Sets the target pathway, pathway element, or annotationRefReferenceable.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
Sets the target pathway, pathway element, or annotationRefReferenceable.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
Returns the list of annotation references.- Specified by:
getAnnotationRefs
in interfaceReferenceable.Annotatable
- Returns:
- annotationRefs the list of annotations referenced, an empty list if no properties are defined.
-
hasAnnotationRef
Checks whether annotationRefs has the given annotationRef.- Specified by:
hasAnnotationRef
in interfaceReferenceable.Annotatable
- Parameters:
annotationRef
- the annotationRef to look for.- Returns:
- true if has annotationRef, false otherwise.
-
addAnnotation
Creates and adds an annotationRef to annotationRefs list.Sets annotable for the given annotationRef.- Specified by:
addAnnotation
in interfaceReferenceable.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. CallsaddAnnotation(Annotation annotation)
.- Specified by:
addAnnotation
in interfaceReferenceable.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. CallsaddAnnotation(Annotation annotation)
.- Specified by:
addAnnotation
in interfaceReferenceable.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
Removes given annotationRef from annotationRefs list. The annotationRef ceases to exist and is terminated.- Specified by:
removeAnnotationRef
in interfaceReferenceable.Annotatable
- Parameters:
annotationRef
- the annotationRef to be removed.
-
removeAnnotationRefs
public void removeAnnotationRefs()Removes all annotationRefs from annotationRefs list.- Specified by:
removeAnnotationRefs
in interfaceReferenceable.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 classjava.lang.Object
-