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

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

public class AtomRelationshipImpl
extends RelationshipImpl
implements AtomRelationship

Implementation of the Relationship interface.

Author:
Brian Carlsen, Deborah Shapiro

Nested Class Summary
 
Nested classes inherited from class gov.nih.nlm.umls.meta.AtomElement
AtomElement.ByLanguageRestrictor, AtomElement.BySourceRestrictor
 
Nested classes inherited from class gov.nih.nlm.umls.meta.SourceElement
SourceElement.BySourceComparator, SourceElement.BySourceRestrictor
 
Field Summary
 
Fields inherited from class gov.nih.nlm.umls.meta.impl.RelationshipImpl
key_fields, key_fields_flag
 
Constructor Summary
AtomRelationshipImpl()
          Instantiates an empty AtomRelationship.
AtomRelationshipImpl(AtomRelationship rel)
          Instantiates an AtomRelationship from the specified AtomRelationship.
 
Method Summary
 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.
 Atom getAtom()
          Returns the Atom this Relationship is connected to.
 String getKeyFields()
          Returns a String key which can be used by equals, compareTo, and hashCode methods.
 Atom getRelatedAtom()
          Returns the related atom involved.
 int hashCode()
          Return a hash code based on key fields.
 void setAtom(Atom atom)
          Sets the Atom this Relationship is connected to.
 void setRelatedAtom(Atom related_atom)
          Sets the related atom involved.
 
Methods inherited from class gov.nih.nlm.umls.meta.impl.RelationshipImpl
addAttribute, clearAttributes, getAdditionalRelationshipLabel, getAttributes, getAttributes, getAttributesAsList, getConcept, getContentView, getCvf, getDir, getRel, getRela, getRelatedConcept, getRelatedSourceIdentifierType, getRelationshipGroup, getRelationshipIdentifier, getRelationshipLabel, getRg, getRui, getSl, getSource, getSourceIdentifierType, getSourceOfLabel, getSourceRelationshipIdentifier, getSrui, getSuppress, isAssertedDirection, isObsolete, isSuppressible, removeAttribute, setAdditionalRelationshipLabel, setAttributes, setAttributes, setConcept, setContentView, setCvf, setDir, setIsAssertedDirection, setRel, setRela, setRelatedConcept, setRelatedSourceIdentifierType, setRelationshipGroup, setRelationshipIdentifier, setRelationshipLabel, setRg, setRui, setSl, setSource, setSourceIdentifierType, setSourceOfLabel, setSourceRelationshipIdentifier, setSrui, setSuppress
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.nih.nlm.umls.meta.Relationship
addAttribute, clearAttributes, getAdditionalRelationshipLabel, getAttributes, getAttributes, getAttributesAsList, getDir, getRel, getRela, getRelationshipGroup, getRelationshipIdentifier, getRelationshipLabel, getRg, getRui, getSl, getSourceOfLabel, getSourceRelationshipIdentifier, getSrui, isAssertedDirection, removeAttribute, setAdditionalRelationshipLabel, setAttributes, setAttributes, setDir, setIsAssertedDirection, setRel, setRela, setRelationshipGroup, setRelationshipIdentifier, setRelationshipLabel, setRg, setRui, setSl, setSourceOfLabel, setSourceRelationshipIdentifier, setSrui
 
Methods inherited from interface gov.nih.nlm.umls.meta.ConceptElement
getConcept, setConcept
 
Methods inherited from interface gov.nih.nlm.umls.meta.ContentViewElement
getContentView, getCvf, setContentView, setCvf
 
Methods inherited from interface gov.nih.nlm.umls.meta.RelatedConceptElement
getRelatedConcept, setRelatedConcept
 
Methods inherited from interface gov.nih.nlm.umls.meta.RelatedSourceIdentifierElement
getRelatedSourceIdentifierType, setRelatedSourceIdentifierType
 
Methods inherited from interface gov.nih.nlm.umls.meta.SourceElement
getSource, setSource
 
Methods inherited from interface gov.nih.nlm.umls.meta.SourceIdentifierElement
getSourceIdentifierType, setSourceIdentifierType
 
Methods inherited from interface gov.nih.nlm.umls.meta.SuppressibleElement
getSuppress, isObsolete, isSuppressible, setSuppress
 

Constructor Detail

AtomRelationshipImpl

public AtomRelationshipImpl()
Instantiates an empty AtomRelationship.


AtomRelationshipImpl

public AtomRelationshipImpl(AtomRelationship rel)
Instantiates an AtomRelationship from the specified AtomRelationship.

Parameters:
rel - AtomRelationship to be copied
Method Detail

getRelatedAtom

public Atom getRelatedAtom()
Returns the related atom involved.

Specified by:
getRelatedAtom in interface RelatedAtomElement
Overrides:
getRelatedAtom in class RelationshipImpl
Returns:
the related atom involved Atom

setRelatedAtom

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

Specified by:
setRelatedAtom in interface RelatedAtomElement
Overrides:
setRelatedAtom in class RelationshipImpl
Parameters:
related_atom - the related atom involved

getAtom

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

Specified by:
getAtom in interface AtomElement
Overrides:
getAtom in class RelationshipImpl
Returns:
the Atom this Relationship is connected to

setAtom

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

Specified by:
setAtom in interface AtomElement
Overrides:
setAtom in class RelationshipImpl
Parameters:
atom - the Atom this Relationship is connected to

getKeyFields

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

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

hashCode

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

Overrides:
hashCode in class RelationshipImpl
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 AtomRelationship with matching key fields.

Overrides:
equals in class RelationshipImpl
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
Overrides:
compareTo in class RelationshipImpl
Parameters:
o - the Object to compare to
Returns:
int representing the relative ordering of this and the compare-to object


Copyright ©2005