Package org.pathvisio.libgpml.model
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
-
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 Referenceable.Annotatable
annotatable
private Annotation
annotation
private java.util.List<PathwayElement.CitationRef>
citationRefs
private java.util.List<PathwayElement.EvidenceRef>
evidenceRefs
-
Constructor Summary
Constructors Constructor Description AnnotationRef(Annotation annotation)
Instantiates an AnnotationRef given sourceAnnotation
and initializes citationRefs and evidenceRefs lists. -
Method Summary
Modifier and Type Method Description 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.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.PathwayElement.CitationRef
addCitation(Citation citation)
Creates and adds an citationRef to citationRefs list.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.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.PathwayElement.EvidenceRef
addEvidence(Evidence evidence)
Creates and adds an evidenceRef to evidenceRefs list.Referenceable.Annotatable
getAnnotatable()
Returns the target pathway, pathway element, or citationRefReferenceable.Annotatable
for this annotationRef.Annotation
getAnnotation()
Returns the annotation referenced.java.util.List<PathwayElement.CitationRef>
getCitationRefs()
Returns the list of citation references.java.util.List<PathwayElement.EvidenceRef>
getEvidenceRefs()
Returns the list of evidence references.boolean
hasAnnotatable()
Checks whether this annotationRef has a target annotatable.boolean
hasAnnotation()
Checks whether this annotationRef has a source annotation.boolean
hasCitationRef(PathwayElement.CitationRef citationRef)
Checks whether citationRefs has the given citationRef.boolean
hasEvidenceRef(PathwayElement.EvidenceRef evidenceRef)
Checks whether citationRefs has the given citationRef.void
removeCitationRef(PathwayElement.CitationRef citationRef)
Removes given citationRef from citationRefs list.void
removeCitationRefs()
Removes all citationRef from citationRefs list.void
removeEvidenceRef(PathwayElement.EvidenceRef evidenceRef)
Removes given evidenceRef from evidenceRefs list.void
removeEvidenceRefs()
Removes all evidenceRefs from evidenceRefs list.private void
setAnnotatable(Referenceable.Annotatable v)
Sets the target pathway, pathway element, or citationRefReferenceable.Annotatable
for this annotationRef.protected void
setAnnotatableTo(Referenceable.Annotatable annotatable)
Sets the target pathway element or citationRefReferenceable.Annotatable
for this annotationRef.private void
setAnnotation(Annotation v)
Sets the source annotation for this annotationRef.void
setAnnotationTo(Annotation annotation)
Sets the source annotation for this annotationRef.protected void
terminate()
Terminates this annotationRef.java.lang.String
toString()
Writes annotationRef out as a string.protected void
unsetAnnotatable()
Unsets the annotatable, if any, from this annotationRef.protected void
unsetAnnotation()
Unsets the annotation, if any, from this annotationRef.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
-
annotation
-
annotatable
-
citationRefs
-
evidenceRefs
-
-
Constructor Details
-
AnnotationRef
Instantiates an AnnotationRef given sourceAnnotation
and initializes citationRefs and evidenceRefs lists.- Parameters:
annotation
- the source annotation this AnnotationRef refers to.
-
-
Method Details
-
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
Sets the source annotation for this annotationRef. Adds this annotationRef to the source annotation.- Parameters:
annotation
- the given source annotation to set.
-
setAnnotation
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
Returns the target pathway, pathway element, or citationRefReferenceable.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
Sets the target pathway element or citationRefReferenceable.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
Sets the target pathway, pathway element, or citationRefReferenceable.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
Returns the list of citation references.- Specified by:
getCitationRefs
in interfaceReferenceable.Citable
- Returns:
- citationRefs the list of citations referenced, an empty list if no properties are defined.
-
hasCitationRef
Checks whether citationRefs has the given citationRef.- Specified by:
hasCitationRef
in interfaceReferenceable.Citable
- Parameters:
citationRef
- the citationRef to look for.- Returns:
- true if has citationRef, false otherwise.
-
addCitation
Creates and adds an citationRef to citationRefs list. Sets citable for the given citationRef.- Specified by:
addCitation
in interfaceReferenceable.Citable
- Parameters:
citation
- the citation for citationRef.- Returns:
- the citationRef of added citation.
-
addCitation
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 interfaceReferenceable.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. CallsaddCitation(Citation citation)
.- Specified by:
addCitation
in interfaceReferenceable.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
Removes given citationRef from citationRefs list. The citationRef ceases to exist and is terminated.- Specified by:
removeCitationRef
in interfaceReferenceable.Citable
- Parameters:
citationRef
- the citationRef to be removed.
-
removeCitationRefs
public void removeCitationRefs()Removes all citationRef from citationRefs list.- Specified by:
removeCitationRefs
in interfaceReferenceable.Citable
-
getEvidenceRefs
Returns the list of evidence references.- Specified by:
getEvidenceRefs
in interfaceReferenceable.Evidenceable
- Returns:
- evidenceRefs the list of evidences referenced, an empty list if no properties are defined.
-
hasEvidenceRef
Checks whether citationRefs has the given citationRef.- Specified by:
hasEvidenceRef
in interfaceReferenceable.Evidenceable
- Parameters:
evidenceRef
- the evidenceRef to look for.- Returns:
- true if has evidenceRef, false otherwise.
-
addEvidence
Creates and adds an evidenceRef to evidenceRefs list. Sets evidenceable for the given evidenceRef.- Specified by:
addEvidence
in interfaceReferenceable.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. CallsaddEvidence(Evidence evidence)
.- Specified by:
addEvidence
in interfaceReferenceable.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. CallsaddEvidence(Evidence evidence)
.- Specified by:
addEvidence
in interfaceReferenceable.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
Removes given evidenceRef from evidenceRefs list. The evidenceRef ceases to exist and is terminated.- Specified by:
removeEvidenceRef
in interfaceReferenceable.Evidenceable
- Parameters:
evidenceRef
- the evidenceRef to be removed.
-
removeEvidenceRefs
public void removeEvidenceRefs()Removes all evidenceRefs from evidenceRefs list.- Specified by:
removeEvidenceRefs
in interfaceReferenceable.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 classjava.lang.Object
-