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

java.lang.Object
  extended bygov.nih.nlm.umls.meta.impl.CoocurrenceGroupImpl
All Implemented Interfaces:
AtomElement, Comparable, ConceptElement, CoocurrenceGroup, RelatedAtomElement, RelatedConceptElement

public class CoocurrenceGroupImpl
extends Object
implements CoocurrenceGroup

Default implementation of the CoocurrenceGroup interface.

Author:
Brian Carlsen, Deborah Shapiro

Nested Class Summary
 
Nested classes inherited from class gov.nih.nlm.umls.meta.AtomElement
AtomElement.ByLanguageRestrictor, AtomElement.BySourceRestrictor
 
Constructor Summary
CoocurrenceGroupImpl()
          Instantiates an empty CoocurrenceGroup.
CoocurrenceGroupImpl(CoocurrenceGroup cg)
          Instantiates a CoocurrenceGroup from the specified CoocurrenceGroup.
 
Method Summary
 void addCoocurrenceContext(CoocurrenceContext coc_context)
          Adds the specified CoocurrenceContext.
 void clearCoocurrenceContexts()
          Removes all CoocurrenceContexts.
 int compareTo(Object o)
          Compares this CoocurrenceGroup to another one.
 boolean equals(Object o)
          Returns true if the specified object is equal to this object.
 Atom getAtom()
          Returns the Atom this CoocurrenceGroup is connected to.
 Concept getConcept()
          Returns the Concept that holds this CoocurrenceGroup.
 CoocurrenceContext[] getCoocurrenceContexts()
          Returns the CoocurrenceContexts .
 List getCoocurrenceContextsAsList()
          Returns the CoocurrenceContexts as a List.
 String getKeyFields()
          Returns a String key which can be used by equals, compareTo, and hashCode methods.
 Atom getRelatedAtom()
          Returns the related Atom involved.
 Concept getRelatedConcept()
          Returns the related concept involved.
 int hashCode()
          Return a hash code based on key fields.
 void removeCoocurrenceContext(CoocurrenceContext coc_context)
          Removes the specified CoocurrenceContext.
 void setAtom(Atom string_source)
          Sets the Atom this CoocurrenceGroup is connected to.
 void setConcept(Concept concept)
          Sets the Concept that holds this CoocurrenceGroup.
 void setCoocurrenceContexts(CoocurrenceContext[] coc_contexts)
          Replaces the CoocurrenceContexts with those in the specified array.
 void setCoocurrenceContexts(List coc_contexts)
          Replaces the CoocurrenceContexts with those in the specified List
 void setCoocurrenceContexts(String cxt_contexts)
          Sets the coocurrence attribute value.
 void setRelatedAtom(Atom related_string_source)
          Sets the related Atom involved.
 void setRelatedConcept(Concept related_concept)
          Sets the second concept involved.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoocurrenceGroupImpl

public CoocurrenceGroupImpl()
Instantiates an empty CoocurrenceGroup.


CoocurrenceGroupImpl

public CoocurrenceGroupImpl(CoocurrenceGroup cg)
Instantiates a CoocurrenceGroup from the specified CoocurrenceGroup.

Parameters:
cg - CoocurrenceGroup to be copied
Method Detail

getAtom

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

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

setAtom

public void setAtom(Atom string_source)
Sets the Atom this CoocurrenceGroup is connected to.

Specified by:
setAtom in interface AtomElement
Parameters:
string_source - the Atom this CoocurrenceGroup is connected to

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 second concept involved.

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

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_string_source)
Sets the related Atom involved.

Specified by:
setRelatedAtom in interface RelatedAtomElement
Parameters:
related_string_source - the related Atom involved

getCoocurrenceContexts

public CoocurrenceContext[] getCoocurrenceContexts()
Returns the CoocurrenceContexts .

Specified by:
getCoocurrenceContexts in interface CoocurrenceGroup
Returns:
an array of CoocurrenceContexts

getCoocurrenceContextsAsList

public List getCoocurrenceContextsAsList()
Returns the CoocurrenceContexts as a List.

Specified by:
getCoocurrenceContextsAsList in interface CoocurrenceGroup
Returns:
the CoocurrenceContexts as a List

setCoocurrenceContexts

public void setCoocurrenceContexts(String cxt_contexts)
Sets the coocurrence attribute value. This is a comma separated list of name=value pairs.

Specified by:
setCoocurrenceContexts in interface CoocurrenceGroup
Parameters:
cxt_contexts - the coocuurence attribute value

setCoocurrenceContexts

public void setCoocurrenceContexts(CoocurrenceContext[] coc_contexts)
Replaces the CoocurrenceContexts with those in the specified array.

Specified by:
setCoocurrenceContexts in interface CoocurrenceGroup
Parameters:
coc_contexts - an array of CoocurrenceContexts

setCoocurrenceContexts

public void setCoocurrenceContexts(List coc_contexts)
Replaces the CoocurrenceContexts with those in the specified List

Specified by:
setCoocurrenceContexts in interface CoocurrenceGroup
Parameters:
coc_contexts - a List of CoocurrenceContexts

addCoocurrenceContext

public void addCoocurrenceContext(CoocurrenceContext coc_context)
Adds the specified CoocurrenceContext.

Specified by:
addCoocurrenceContext in interface CoocurrenceGroup
Parameters:
coc_context - the CoocurrenceContext to be added

removeCoocurrenceContext

public void removeCoocurrenceContext(CoocurrenceContext coc_context)
Removes the specified CoocurrenceContext.

Specified by:
removeCoocurrenceContext in interface CoocurrenceGroup
Parameters:
coc_context - the CoocurrenceContext to be removed

clearCoocurrenceContexts

public void clearCoocurrenceContexts()
Removes all CoocurrenceContexts.

Specified by:
clearCoocurrenceContexts in interface CoocurrenceGroup

getConcept

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

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

setConcept

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

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

getKeyFields

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

Specified by:
getKeyFields in interface CoocurrenceGroup
Returns:
a String composed from the cui1, aui1, cui2, and aui2.

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 a CoocurrenceGroup 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 CoocurrenceGroup 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