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

java.lang.Object
  extended bygov.nih.nlm.umls.meta.impl.CoocurrenceImpl
      extended bygov.nih.nlm.umls.meta.impl.AtomCoocurrenceImpl
All Implemented Interfaces:
AtomCoocurrence, AtomElement, Comparable, ConceptElement, ContentViewElement, Coocurrence, RelatedAtomElement, RelatedConceptElement, SourceElement

public class AtomCoocurrenceImpl
extends CoocurrenceImpl
implements AtomCoocurrence

Default implementation of the Coocurrence 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.CoocurrenceImpl
key_fields, key_fields_flag
 
Constructor Summary
AtomCoocurrenceImpl()
          Instantiates an empty AtomCoocurrence.
AtomCoocurrenceImpl(AtomCoocurrence co)
          Instantiates an AtomCoocurrence from the specified AtomCoocurrence.
 
Method Summary
 int compareTo(Object o)
          Compares this AtomCoocurrence to another one.
 boolean equals(Object o)
          Returns true if the specified object is equal to this object.
 Atom getAtom()
          Returns the Atom this AtomCoocurrence 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 AtomCoocurrence is connected to.
 void setRelatedAtom(Atom related_atom)
          Sets the second atom involved.
 
Methods inherited from class gov.nih.nlm.umls.meta.impl.CoocurrenceImpl
getCoa, getCof, getConcept, getContentView, getCoocurrenceAttribute, getCoocurrenceFrequency, getCoocurrenceType, getCot, getCvf, getQualifierAsList, getQualifiers, getRelatedConcept, getSource, setCoa, setCof, setConcept, setContentView, setCoocurrenceAttribute, setCoocurrenceFrequency, setCoocurrenceType, setCot, setCvf, setQualifiers, setQualifiers, setRelatedConcept, setSource
 
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.Coocurrence
getCoa, getCof, getCoocurrenceAttribute, getCoocurrenceFrequency, getCoocurrenceType, getCot, getQualifierAsList, getQualifiers, setCoa, setCof, setCoocurrenceAttribute, setCoocurrenceFrequency, setCoocurrenceType, setCot, setQualifiers, setQualifiers
 
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.SourceElement
getSource, setSource
 

Constructor Detail

AtomCoocurrenceImpl

public AtomCoocurrenceImpl()
Instantiates an empty AtomCoocurrence.


AtomCoocurrenceImpl

public AtomCoocurrenceImpl(AtomCoocurrence co)
Instantiates an AtomCoocurrence from the specified AtomCoocurrence.

Parameters:
co - AtomCoocurrence to be copied
Method Detail

getRelatedAtom

public Atom getRelatedAtom()
Returns the related atom involved.

Specified by:
getRelatedAtom in interface RelatedAtomElement
Returns:
the related atom involved

setRelatedAtom

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

Specified by:
setRelatedAtom in interface RelatedAtomElement
Parameters:
related_atom - the related concept involved

getAtom

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

Specified by:
getAtom in interface AtomElement
Returns:
the Atom this AtomCoocurrence is connected to

setAtom

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

Specified by:
setAtom in interface AtomElement
Parameters:
atom - the Atom this AtomCoocurrence 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 Coocurrence
Overrides:
getKeyFields in class CoocurrenceImpl
Returns:
a String composed from the cui, aui, cui2, aui2, versioned source, and cot.

hashCode

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

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

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


Copyright ©2005