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>annotationRefsprivate Referenceable.Citablecitableprivate Citationcitation -
Constructor Summary
Constructors Modifier Constructor Description protectedCitationRef(Citation citation)Instantiates an CitationRef given sourceCitationand initializes annotationRefs lists. -
Method Summary
Modifier and Type Method Description PathwayElement.AnnotationRefaddAnnotation(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.AnnotationRefaddAnnotation(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.AnnotationRefaddAnnotation(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.CitablegetCitable()Returns the target pathway, pathway element, or annotationRefReferenceable.Citablefor this citationRef.CitationgetCitation()Returns the citation referenced.booleanhasAnnotationRef(PathwayElement.AnnotationRef annotationRef)Checks whether annotationRefs has the given annotationRef.booleanhasCitable()Checks whether this citationRef has a target citable.booleanhasCitation()Checks whether this citationRef has a source citation.voidremoveAnnotationRef(PathwayElement.AnnotationRef annotationRef)Removes given annotationRef from annotationRefs list.voidremoveAnnotationRefs()Removes all annotationRefs from annotationRefs list.private voidsetCitable(Referenceable.Citable v)Sets the target pathway, pathway element, or annotationRefReferenceable.Citableto which the annotationRef belongs.protected voidsetCitableTo(Referenceable.Citable citable)Sets the target pathway, pathway element, or annotationRefReferenceable.Citablefor this annotationRef.private voidsetCitation(Citation v)Sets the source citation for this citationRef.voidsetCitationTo(Citation citation)Sets the source citation for this citationRef.protected voidterminate()Terminates this citationRef.java.lang.StringtoString()Writes citationRef out as a string.protected voidunsetCitable()Unsets the citable, if any, from this citationRef.voidunsetCitation()Unsets the citation, if any, from this citationRef.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
-
citation
-
citable
-
annotationRefs
-
-
Constructor Details
-
CitationRef
Instantiates an CitationRef given sourceCitationand 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.Citablefor 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.Citablefor 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.Citableto 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:
getAnnotationRefsin 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:
hasAnnotationRefin 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:
addAnnotationin 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:
addAnnotationin 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:
addAnnotationin 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:
removeAnnotationRefin interfaceReferenceable.Annotatable- Parameters:
annotationRef- the annotationRef to be removed.
-
removeAnnotationRefs
public void removeAnnotationRefs()Removes all annotationRefs from annotationRefs list.- Specified by:
removeAnnotationRefsin 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:
toStringin classjava.lang.Object
-