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.Annotatableannotatableprivate Annotationannotationprivate java.util.List<PathwayElement.CitationRef>citationRefsprivate java.util.List<PathwayElement.EvidenceRef>evidenceRefs -
Constructor Summary
Constructors Constructor Description AnnotationRef(Annotation annotation)Instantiates an AnnotationRef given sourceAnnotationand initializes citationRefs and evidenceRefs lists. -
Method Summary
Modifier and Type Method Description PathwayElement.CitationRefaddCitation(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.CitationRefaddCitation(org.bridgedb.Xref xref, java.lang.String urlLink)Creates a citation with given xref and urlLink, and adds citation to pathway model.PathwayElement.CitationRefaddCitation(Citation citation)Creates and adds an citationRef to citationRefs list.PathwayElement.EvidenceRefaddEvidence(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.EvidenceRefaddEvidence(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.EvidenceRefaddEvidence(Evidence evidence)Creates and adds an evidenceRef to evidenceRefs list.Referenceable.AnnotatablegetAnnotatable()Returns the target pathway, pathway element, or citationRefReferenceable.Annotatablefor this annotationRef.AnnotationgetAnnotation()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.booleanhasAnnotatable()Checks whether this annotationRef has a target annotatable.booleanhasAnnotation()Checks whether this annotationRef has a source annotation.booleanhasCitationRef(PathwayElement.CitationRef citationRef)Checks whether citationRefs has the given citationRef.booleanhasEvidenceRef(PathwayElement.EvidenceRef evidenceRef)Checks whether citationRefs has the given citationRef.voidremoveCitationRef(PathwayElement.CitationRef citationRef)Removes given citationRef from citationRefs list.voidremoveCitationRefs()Removes all citationRef from citationRefs list.voidremoveEvidenceRef(PathwayElement.EvidenceRef evidenceRef)Removes given evidenceRef from evidenceRefs list.voidremoveEvidenceRefs()Removes all evidenceRefs from evidenceRefs list.private voidsetAnnotatable(Referenceable.Annotatable v)Sets the target pathway, pathway element, or citationRefReferenceable.Annotatablefor this annotationRef.protected voidsetAnnotatableTo(Referenceable.Annotatable annotatable)Sets the target pathway element or citationRefReferenceable.Annotatablefor this annotationRef.private voidsetAnnotation(Annotation v)Sets the source annotation for this annotationRef.voidsetAnnotationTo(Annotation annotation)Sets the source annotation for this annotationRef.protected voidterminate()Terminates this annotationRef.java.lang.StringtoString()Writes annotationRef out as a string.protected voidunsetAnnotatable()Unsets the annotatable, if any, from this annotationRef.protected voidunsetAnnotation()Unsets the annotation, if any, from this annotationRef.Methods inherited from class org.pathvisio.libgpml.model.PathwayElement.InfoRef
getTopPathwayElementMethods 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 sourceAnnotationand 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.Annotatablefor 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.Annotatablefor 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.Annotatablefor 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:
getCitationRefsin 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:
hasCitationRefin 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:
addCitationin 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:
addCitationin 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:
addCitationin 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:
removeCitationRefin interfaceReferenceable.Citable- Parameters:
citationRef- the citationRef to be removed.
-
removeCitationRefs
public void removeCitationRefs()Removes all citationRef from citationRefs list.- Specified by:
removeCitationRefsin interfaceReferenceable.Citable
-
getEvidenceRefs
Returns the list of evidence references.- Specified by:
getEvidenceRefsin 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:
hasEvidenceRefin 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:
addEvidencein 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:
addEvidencein 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:
addEvidencein 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:
removeEvidenceRefin interfaceReferenceable.Evidenceable- Parameters:
evidenceRef- the evidenceRef to be removed.
-
removeEvidenceRefs
public void removeEvidenceRefs()Removes all evidenceRefs from evidenceRefs list.- Specified by:
removeEvidenceRefsin 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:
toStringin classjava.lang.Object
-