gov.nih.nlm.umls.meta.impl
Class RelationshipImpl

java.lang.Object
  extended bygov.nih.nlm.umls.meta.impl.RelationshipImpl
All Implemented Interfaces:
Comparable, ConceptElement, ContentViewElement, RelatedConceptElement, RelatedSourceIdentifierElement, Relationship, SourceElement, SourceIdentifierElement, SuppressibleElement
Direct Known Subclasses:
AtomRelationshipImpl

public class RelationshipImpl
extends Object
implements Relationship

Default implementation of the Relationship interface.

Author:
Brian Carlsen, Deborah Shapiro

Nested Class Summary
 
Nested classes inherited from class gov.nih.nlm.umls.meta.SourceElement
SourceElement.BySourceComparator, SourceElement.BySourceRestrictor
 
Field Summary
protected  String key_fields
           
protected  boolean key_fields_flag
           
 
Constructor Summary
RelationshipImpl()
          Instantiates an empty Relationship.
RelationshipImpl(Relationship rel)
          Instantiates a Relationship from the specified Relationship.
 
Method Summary
 void addAttribute(RelationshipAttribute att)
          Adds the specified RelationshipAttribute.
 void clearAttributes()
          Remove all RelationshipAttributes.
 int compareTo(Object o)
          Compares this Relationship to another one.
 boolean equals(Object o)
          Returns true if the specified object is equal to this object.
 AdditionalRelationshipLabel getAdditionalRelationshipLabel()
          Returns the AdditionalRelationshipLabel (RELA).
 Atom getAtom()
          Returns the Atom this Relationship is connected to.
 RelationshipAttribute[] getAttributes()
          Returns the RelationshipAttributes.
 RelationshipAttribute[] getAttributes(Restrictor restrictor)
          Returns a subset of this Relationship's RelationshipAttributes.
 List getAttributesAsList()
          Returns the RelationshipAttributes as a List.
 Concept getConcept()
          Returns the Concept that holds this Relationship.
 ContentView getContentView()
          Returns tbe ContentView definition for this Relationship (CVF).
 ContentView getCvf()
          Shorthand for getContentView().
 String getDir()
          Returns the directionality value (DIR).
 String getKeyFields()
          Returns a String key which can be used by equals, compareTo, and hashCode methods.
 RelationshipLabel getRel()
          Shorthand for getRelationshipLabel().
 AdditionalRelationshipLabel getRela()
          Shorthand for getAdditionalRelationshipLabel().
 Atom getRelatedAtom()
          Returns the related atom involved.
 Concept getRelatedConcept()
          Returns the related concept involved.
 SourceIdentifierType getRelatedSourceIdentifierType()
          Returns the SourceIdentifierType to which this element is connected.
 String getRelationshipGroup()
          Returns the relationship group (RG).
 String getRelationshipIdentifier()
          Returns the Relationship unique identifier (RUI) related to this Relationship.
 RelationshipLabel getRelationshipLabel()
          Returns the RelationshipLabel (REL).
 String getRg()
          Shorthand for getRelationshipGroup().
 String getRui()
          Shorthand for getRelationshipIdentifier().
 Source getSl()
          Shorthand for getSourceOfLabel().
 Source getSource()
          Returns the source for this Relationship.
 SourceIdentifierType getSourceIdentifierType()
          Returns the SourceIdentifierType to which this element is connected.
 Source getSourceOfLabel()
          Returns the source of the relationship label (SL).
 String getSourceRelationshipIdentifier()
          Returns the source asserted relationship identifier (SRUI).
 String getSrui()
          Shorthand for getSourceRelationshipIdentifier().
 Suppressible getSuppress()
          Returns the suppressibility value (SUPPRESS).
 int hashCode()
          Return a hash code based on key fields.
 boolean isAssertedDirection()
          Indicates the directionality of this Relationship.
 boolean isObsolete()
          Indicates whether or not this RelationshipImpl is obsolete.
 boolean isSuppressible()
          Indicates whether or not this Atom is suppressible.
 void removeAttribute(RelationshipAttribute att)
          Removes the specified RelationshipAttribute.
 void setAdditionalRelationshipLabel(AdditionalRelationshipLabel rela)
          Sets the AdditionalRelationshipLabel (RELA).
 void setAtom(Atom atom)
          Sets the Atom this Relationship is connected to.
 void setAttributes(List atts)
          Replace RelationshipAttributes with the ones in the specified List.
 void setAttributes(RelationshipAttribute[] atts)
          Replace RelationshipAttributes with the ones in the specified array.
 void setConcept(Concept concept)
          Sets the Concept that holds this Relationship.
 void setContentView(ContentView cvf)
          Sets tbe ContentView definition for this Relationship (CVF).
 void setCvf(ContentView cvf)
          Shorthand for setContentView(ContentView).
 void setDir(String dir)
          Sets the directionality value (DIR).
 void setIsAssertedDirection(boolean dir)
          Sets the flag indicating the directionality of the Relationship.
 void setRel(RelationshipLabel rel)
          Shorthand for setRelationshipLabel(RelationshipLabel).
 void setRela(AdditionalRelationshipLabel rela)
          Shorthand for setAdditionalRelationshipLabel(AdditionalRelationshipLabel).
 void setRelatedAtom(Atom related_atom)
          Sets the related atom involved.
 void setRelatedConcept(Concept related_concept)
          Sets the related concept involved.
 void setRelatedSourceIdentifierType(SourceIdentifierType sit)
          Sets the SourceIdentifierType to which this element is connected.
 void setRelationshipGroup(String rg)
          Sets the relationship group (RG).
 void setRelationshipIdentifier(String rui)
          Sets the Relationship unique identifier (RUI) related to this Relationship.
 void setRelationshipLabel(RelationshipLabel rel)
          Sets the RelationshipLabel (REL).
 void setRg(String rg)
          Shorthand for getRelationshipGroup().
 void setRui(String rui)
          Shorthand for setRelationshipIdentifier(String).
 void setSl(Source sl)
          Shorthand for setSourceOfLabel(Source).
 void setSource(Source source)
          Sets the source for this Relationship.
 void setSourceIdentifierType(SourceIdentifierType sit)
          Sets the SourceIdentifierType to which this element is connected.
 void setSourceOfLabel(Source sl)
          Sets the source of the relationship label (SL).
 void setSourceRelationshipIdentifier(String srui)
          Sets the source asserted relationship identifier (SRUI).
 void setSrui(String srui)
          Shorthand for setSourceRelationshipIdentifier(String).
 void setSuppress(Suppressible suppress)
          Sets the suppressibility value (SUPPRESS).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

key_fields_flag

protected boolean key_fields_flag

key_fields

protected String key_fields
Constructor Detail

RelationshipImpl

public RelationshipImpl()
Instantiates an empty Relationship.


RelationshipImpl

public RelationshipImpl(Relationship rel)
Instantiates a Relationship from the specified Relationship.

Parameters:
rel - Relationship to be copied
Method Detail

getSourceIdentifierType

public SourceIdentifierType getSourceIdentifierType()
Returns the SourceIdentifierType to which this element is connected.

Specified by:
getSourceIdentifierType in interface SourceIdentifierElement
Returns:
the SourceIdentifierType to which this element is connected

setSourceIdentifierType

public void setSourceIdentifierType(SourceIdentifierType sit)
Sets the SourceIdentifierType to which this element is connected.

Specified by:
setSourceIdentifierType in interface SourceIdentifierElement
Parameters:
sit - the SourceIdentifierType to which this element is connected.

getRelatedSourceIdentifierType

public SourceIdentifierType getRelatedSourceIdentifierType()
Returns the SourceIdentifierType to which this element is connected.

Specified by:
getRelatedSourceIdentifierType in interface RelatedSourceIdentifierElement
Returns:
the SourceIdentifierType to which this element is connected

setRelatedSourceIdentifierType

public void setRelatedSourceIdentifierType(SourceIdentifierType sit)
Sets the SourceIdentifierType to which this element is connected.

Specified by:
setRelatedSourceIdentifierType in interface RelatedSourceIdentifierElement
Parameters:
sit - the SourceIdentifierType to which this element is connected.

getRelationshipLabel

public RelationshipLabel getRelationshipLabel()
Returns the RelationshipLabel (REL).

Specified by:
getRelationshipLabel in interface Relationship
Returns:
the RelationshipLabel

getRel

public RelationshipLabel getRel()
Shorthand for getRelationshipLabel().

Specified by:
getRel in interface Relationship
Returns:
the RelationshipLabel

setRelationshipLabel

public void setRelationshipLabel(RelationshipLabel rel)
Sets the RelationshipLabel (REL).

Specified by:
setRelationshipLabel in interface Relationship
Parameters:
rel - the RelationshipLabel

setRel

public void setRel(RelationshipLabel rel)
Shorthand for setRelationshipLabel(RelationshipLabel).

Specified by:
setRel in interface Relationship
Parameters:
rel - the RelationshipLabel

getRelatedConcept

public Concept getRelatedConcept()
Returns the related concept involved.

Specified by:
getRelatedConcept in interface RelatedConceptElement
Returns:
the related concept involved

setRelatedConcept

public void setRelatedConcept(Concept related_concept)
Sets the related concept involved.

Specified by:
setRelatedConcept in interface RelatedConceptElement
Parameters:
related_concept - the related concept involved

getRelatedAtom

public Atom getRelatedAtom()
Returns the related atom involved.

Returns:
the related atom involved

setRelatedAtom

public void setRelatedAtom(Atom related_atom)
Sets the related atom involved.

Parameters:
related_atom - the related atom involved

getAdditionalRelationshipLabel

public AdditionalRelationshipLabel getAdditionalRelationshipLabel()
Returns the AdditionalRelationshipLabel (RELA).

Specified by:
getAdditionalRelationshipLabel in interface Relationship
Returns:
the AdditionalRelationshipLabel

getRela

public AdditionalRelationshipLabel getRela()
Shorthand for getAdditionalRelationshipLabel().

Specified by:
getRela in interface Relationship
Returns:
the AdditionalRelationshipLabel

setAdditionalRelationshipLabel

public void setAdditionalRelationshipLabel(AdditionalRelationshipLabel rela)
Sets the AdditionalRelationshipLabel (RELA).

Specified by:
setAdditionalRelationshipLabel in interface Relationship
Parameters:
rela - the AdditionalRelationshipLabel

setRela

public void setRela(AdditionalRelationshipLabel rela)
Shorthand for setAdditionalRelationshipLabel(AdditionalRelationshipLabel).

Specified by:
setRela in interface Relationship
Parameters:
rela - the AdditionalRelationshipLabel

getSourceRelationshipIdentifier

public String getSourceRelationshipIdentifier()
Returns the source asserted relationship identifier (SRUI).

Specified by:
getSourceRelationshipIdentifier in interface Relationship
Returns:
the source asserted relationship identifier

getSrui

public String getSrui()
Shorthand for getSourceRelationshipIdentifier().

Specified by:
getSrui in interface Relationship
Returns:
the source asserted relationship identifier

setSourceRelationshipIdentifier

public void setSourceRelationshipIdentifier(String srui)
Sets the source asserted relationship identifier (SRUI).

Specified by:
setSourceRelationshipIdentifier in interface Relationship
Parameters:
srui - the source asserted relationship identifier

setSrui

public void setSrui(String srui)
Shorthand for setSourceRelationshipIdentifier(String).

Specified by:
setSrui in interface Relationship
Parameters:
srui - the source asserted relationship identifier

getSourceOfLabel

public Source getSourceOfLabel()
Returns the source of the relationship label (SL).

Specified by:
getSourceOfLabel in interface Relationship
Returns:
the source of the relationship label

getSl

public Source getSl()
Shorthand for getSourceOfLabel().

Specified by:
getSl in interface Relationship
Returns:
the source of the relationship label

setSourceOfLabel

public void setSourceOfLabel(Source sl)
Sets the source of the relationship label (SL).

Specified by:
setSourceOfLabel in interface Relationship
Parameters:
sl - the source of the relationship label

setSl

public void setSl(Source sl)
Shorthand for setSourceOfLabel(Source).

Specified by:
setSl in interface Relationship
Parameters:
sl - the source of the relationship label

getRelationshipGroup

public String getRelationshipGroup()
Returns the relationship group (RG).

Specified by:
getRelationshipGroup in interface Relationship
Returns:
the relationship group

getRg

public String getRg()
Shorthand for getRelationshipGroup().

Specified by:
getRg in interface Relationship
Returns:
the relationship group

setRelationshipGroup

public void setRelationshipGroup(String rg)
Sets the relationship group (RG).

Specified by:
setRelationshipGroup in interface Relationship
Parameters:
rg - the relationship group

setRg

public void setRg(String rg)
Shorthand for getRelationshipGroup().

Specified by:
setRg in interface Relationship
Parameters:
rg - the relationship group

getAtom

public Atom getAtom()
Returns the Atom this Relationship is connected to.

Returns:
the Atom this Relationship is connected to

setAtom

public void setAtom(Atom atom)
Sets the Atom this Relationship is connected to.

Parameters:
atom - the Atom this Relationship is connected to

getSource

public Source getSource()
Returns the source for this Relationship.

Specified by:
getSource in interface SourceElement
Returns:
Source

setSource

public void setSource(Source source)
Sets the source for this Relationship.

Specified by:
setSource in interface SourceElement
Parameters:
source - Source

getSuppress

public Suppressible getSuppress()
Returns the suppressibility value (SUPPRESS).

Specified by:
getSuppress in interface SuppressibleElement
Returns:
the Suppressible value

isSuppressible

public boolean isSuppressible()
Indicates whether or not this Atom is suppressible.

Specified by:
isSuppressible in interface SuppressibleElement
Returns:
true if suppressible, false if not suppressible

setSuppress

public void setSuppress(Suppressible suppress)
Sets the suppressibility value (SUPPRESS).

Specified by:
setSuppress in interface SuppressibleElement
Parameters:
suppress - the Suppressible value

setDir

public void setDir(String dir)
Sets the directionality value (DIR).

Specified by:
setDir in interface Relationship
Parameters:
dir - the directionality value

getDir

public String getDir()
Returns the directionality value (DIR).

Specified by:
getDir in interface Relationship
Returns:
the directionality value

isAssertedDirection

public boolean isAssertedDirection()
Indicates the directionality of this Relationship.

Specified by:
isAssertedDirection in interface Relationship
Returns:
true if directionality is in order read, false if directionality is reversed

setIsAssertedDirection

public void setIsAssertedDirection(boolean dir)
Sets the flag indicating the directionality of the Relationship.

Specified by:
setIsAssertedDirection in interface Relationship
Parameters:
dir - true if directionality is in order read, false if directionality is reversed

getConcept

public Concept getConcept()
Returns the Concept that holds this Relationship.

Specified by:
getConcept in interface ConceptElement
Returns:
the Concept that holds this Relationship

setConcept

public void setConcept(Concept concept)
Sets the Concept that holds this Relationship.

Specified by:
setConcept in interface ConceptElement
Parameters:
concept - the Concept that holds this Relationship

getRui

public String getRui()
Shorthand for getRelationshipIdentifier().

Specified by:
getRui in interface Relationship
Returns:
the RUI

setRui

public void setRui(String rui)
Shorthand for setRelationshipIdentifier(String).

Specified by:
setRui in interface Relationship
Parameters:
rui - the RUI

getRelationshipIdentifier

public String getRelationshipIdentifier()
Returns the Relationship unique identifier (RUI) related to this Relationship.

Specified by:
getRelationshipIdentifier in interface Relationship
Returns:
the RUI

setRelationshipIdentifier

public void setRelationshipIdentifier(String rui)
Sets the Relationship unique identifier (RUI) related to this Relationship.

Specified by:
setRelationshipIdentifier in interface Relationship
Parameters:
rui - the RUI

getContentView

public ContentView getContentView()
Returns tbe ContentView definition for this Relationship (CVF).

Specified by:
getContentView in interface ContentViewElement
Returns:
tbe ContentView definition

setContentView

public void setContentView(ContentView cvf)
Sets tbe ContentView definition for this Relationship (CVF).

Specified by:
setContentView in interface ContentViewElement
Parameters:
cvf - the ContentView definition

getCvf

public ContentView getCvf()
Shorthand for getContentView().

Specified by:
getCvf in interface ContentViewElement
Returns:
tbe ContentView definition

setCvf

public void setCvf(ContentView cvf)
Shorthand for setContentView(ContentView).

Specified by:
setCvf in interface ContentViewElement
Parameters:
cvf - the ContentView definition

getAttributes

public RelationshipAttribute[] getAttributes()
Returns the RelationshipAttributes.

Specified by:
getAttributes in interface Relationship
Returns:
a RelationshipAttribute []

getAttributesAsList

public List getAttributesAsList()
Returns the RelationshipAttributes as a List.

Specified by:
getAttributesAsList in interface Relationship
Returns:
the RelationshipAttributes as a List

addAttribute

public void addAttribute(RelationshipAttribute att)
Adds the specified RelationshipAttribute.

Specified by:
addAttribute in interface Relationship
Parameters:
att - the RelationshipAttribute to be added

removeAttribute

public void removeAttribute(RelationshipAttribute att)
Removes the specified RelationshipAttribute.

Specified by:
removeAttribute in interface Relationship
Parameters:
att - the RelationshipAttribute to be removed

clearAttributes

public void clearAttributes()
Remove all RelationshipAttributes.

Specified by:
clearAttributes in interface Relationship

setAttributes

public void setAttributes(RelationshipAttribute[] atts)
Replace RelationshipAttributes with the ones in the specified array.

Specified by:
setAttributes in interface Relationship
Parameters:
atts - an RelationshipAttribute []

setAttributes

public void setAttributes(List atts)
Replace RelationshipAttributes with the ones in the specified List.

Specified by:
setAttributes in interface Relationship
Parameters:
atts - a List of RelationshipAttributes

getAttributes

public RelationshipAttribute[] getAttributes(Restrictor restrictor)
Returns a subset of this Relationship's RelationshipAttributes. Restricts the return based on the given Restrictor.

Specified by:
getAttributes in interface Relationship
Parameters:
restrictor - Restrictor
Returns:
RelationshipAttribute[]

isObsolete

public boolean isObsolete()
Indicates whether or not this RelationshipImpl is obsolete.

Specified by:
isObsolete in interface SuppressibleElement
Returns:
true if obsolete, false if not obsolete

getKeyFields

public String getKeyFields()
Returns a String key which can be used by equals, compareTo, and hashCode methods.

Specified by:
getKeyFields in interface Relationship
Returns:
a String composed from the cui1, rel, versioned source, cui2, rela, suppress, rui, sl, and srui.

hashCode

public int hashCode()
Return a hash code based on key fields.

Returns:
a hash code based on key fields

equals

public boolean equals(Object o)
Returns true if the specified object is equal to this object. The specified object must be an Relationship with matching key fields.

Parameters:
o - an Object to compare against
Returns:
boolean true if Object o is equal false otherwise

compareTo

public int compareTo(Object o)
Compares this Relationship to another one. Results are indeterminate if the specified parameter is not of the same class.

Specified by:
compareTo in interface Comparable
Parameters:
o - the Object to compare to
Returns:
int representing the relative ordering of this and the compare-to object


Copyright ©2005