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

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

public class CoocurrenceImpl
extends Object
implements Coocurrence

Default implementation of the Coocurrence 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
CoocurrenceImpl()
          Instantiates an empty Coocurrence.
CoocurrenceImpl(Coocurrence co)
          Instantiates a Coocurrence from the specified Coocurrence.
 
Method Summary
 int compareTo(Object o)
          Compares this Coocurrence to another one.
 boolean equals(Object o)
          Returns true if the specified object is equal to this object.
 String getCoa()
          Shorthand for getCoocurrenceAttribute().
 int getCof()
          Shorthand for getCoocurrenceFrequency().
 Concept getConcept()
          Returns the Concept that holds this Coocurrence.
 ContentView getContentView()
          Returns tbe ContentView definition for this Coocurrence (CVF).
 String getCoocurrenceAttribute()
          Returns the coocurrence attribute value (COA).
 int getCoocurrenceFrequency()
          Returns the coocurrence frequency (COF).
 CoocurrenceType getCoocurrenceType()
          Returns the CoocurrenceType (COT).
 CoocurrenceType getCot()
          Shorthand for getCoocurrenceType().
 ContentView getCvf()
          Shorthand for getContentView().
 String getKeyFields()
          Returns a String key which can be used by equals, compareTo, and hashCode methods.
 List getQualifierAsList()
          Returns the QualifierFrequency values as a List.
 QualifierFrequency[] getQualifiers()
          Returns the QualifierFrequency list.
 Concept getRelatedConcept()
          Returns the related concept involved.
 Source getSource()
          Returns the source for this Coocurrence.
 int hashCode()
          Return a hash code based on key fields.
 void setCoa(String coa)
          Shorthand for setCoocurrenceAttribute(String).
 void setCof(int cof)
          Shorthand for setCoocurrenceFrequency(int).
 void setConcept(Concept concept)
          Sets the Concept that holds this Coocurrence.
 void setContentView(ContentView cvf)
          Sets tbe ContentView definition for this Coocurrence (CVF).
 void setCoocurrenceAttribute(String coa)
          Sets the coocurrence attribute value (COA).
 void setCoocurrenceFrequency(int cof)
          Sets the coocurrence frequency (COF).
 void setCoocurrenceType(CoocurrenceType cot)
          Sets the CoocurrenceType (COT).
 void setCot(CoocurrenceType cot)
          Shorthand for setCoocurrenceType(CoocurrenceType).
 void setCvf(ContentView cvf)
          Shorthand for setContentView(ContentView).
 void setQualifiers(List coa)
          Replaces the QualifierFrequency values with those in the specified List
 void setQualifiers(QualifierFrequency[] coa)
          Replaces the QualifierFrequency values with those in the specified array.
 void setRelatedConcept(Concept related_concept)
          Sets the related concept involved.
 void setSource(Source source)
          Sets the source for this Coocurrence.
 
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

CoocurrenceImpl

public CoocurrenceImpl()
Instantiates an empty Coocurrence.


CoocurrenceImpl

public CoocurrenceImpl(Coocurrence co)
Instantiates a Coocurrence from the specified Coocurrence.

Parameters:
co - Coocurrence to be copied
Method Detail

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

getCoocurrenceType

public CoocurrenceType getCoocurrenceType()
Returns the CoocurrenceType (COT).

Specified by:
getCoocurrenceType in interface Coocurrence
Returns:
the CoocurrenceType

getCot

public CoocurrenceType getCot()
Shorthand for getCoocurrenceType().

Specified by:
getCot in interface Coocurrence
Returns:
the CoocurrenceType

setCoocurrenceType

public void setCoocurrenceType(CoocurrenceType cot)
Sets the CoocurrenceType (COT).

Specified by:
setCoocurrenceType in interface Coocurrence
Parameters:
cot - the CoocurrenceType

setCot

public void setCot(CoocurrenceType cot)
Shorthand for setCoocurrenceType(CoocurrenceType).

Specified by:
setCot in interface Coocurrence
Parameters:
cot - the CoocurrenceType

getCoocurrenceFrequency

public int getCoocurrenceFrequency()
Returns the coocurrence frequency (COF).

Specified by:
getCoocurrenceFrequency in interface Coocurrence
Returns:
the coocurrence frequency

getCof

public int getCof()
Shorthand for getCoocurrenceFrequency().

Specified by:
getCof in interface Coocurrence
Returns:
the coocurrence frequency

setCoocurrenceFrequency

public void setCoocurrenceFrequency(int cof)
Sets the coocurrence frequency (COF).

Specified by:
setCoocurrenceFrequency in interface Coocurrence
Parameters:
cof - the coocurrence frequency

setCof

public void setCof(int cof)
Shorthand for setCoocurrenceFrequency(int).

Specified by:
setCof in interface Coocurrence
Parameters:
cof - the coocurrence frequency

getCoa

public String getCoa()
Shorthand for getCoocurrenceAttribute().

Specified by:
getCoa in interface Coocurrence
Returns:
the coocurrence attribute value

getCoocurrenceAttribute

public String getCoocurrenceAttribute()
Returns the coocurrence attribute value (COA).

Specified by:
getCoocurrenceAttribute in interface Coocurrence
Returns:
the coocurrence attribute value

setCoocurrenceAttribute

public void setCoocurrenceAttribute(String coa)
Sets the coocurrence attribute value (COA). This is a comma separated list of nqualifier=frequency pairs.

Specified by:
setCoocurrenceAttribute in interface Coocurrence
Parameters:
coa - the coocuurence attribute value

setCoa

public void setCoa(String coa)
Shorthand for setCoocurrenceAttribute(String).

Specified by:
setCoa in interface Coocurrence
Parameters:
coa - the coocuurence attribute value

getQualifiers

public QualifierFrequency[] getQualifiers()
Returns the QualifierFrequency list.

Specified by:
getQualifiers in interface Coocurrence
Returns:
an array of QualifierFrequencys

getQualifierAsList

public List getQualifierAsList()
Returns the QualifierFrequency values as a List.

Specified by:
getQualifierAsList in interface Coocurrence
Returns:
the QualifierFrequency values as a List

setQualifiers

public void setQualifiers(QualifierFrequency[] coa)
Replaces the QualifierFrequency values with those in the specified array.

Specified by:
setQualifiers in interface Coocurrence
Parameters:
coa - an array of QualifierFrequency values

setQualifiers

public void setQualifiers(List coa)
Replaces the QualifierFrequency values with those in the specified List

Specified by:
setQualifiers in interface Coocurrence
Parameters:
coa - a List of QualifierFrequency values

getConcept

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

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

setConcept

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

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

getSource

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

Specified by:
getSource in interface SourceElement
Returns:
Source

setSource

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

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

getContentView

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

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

setContentView

public void setContentView(ContentView cvf)
Sets tbe ContentView definition for this Coocurrence (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

getKeyFields

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

Specified by:
getKeyFields in interface Coocurrence
Returns:
a String composed from the cui1, aui1, aui2, versioned source, cui2, cof and cot.

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 Coocurrence 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 Coocurrence 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