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

java.lang.Object
  extended bygov.nih.nlm.umls.meta.impl.CoocurrenceContextImpl
All Implemented Interfaces:
Comparable, ContentViewElement, CoocurrenceContext, SourceElement

public class CoocurrenceContextImpl
extends Object
implements CoocurrenceContext

Default implementation of the CoocurrenceContext interface.

Author:
Brian Carlsen, Deborah Shapiro

Nested Class Summary
 
Nested classes inherited from class gov.nih.nlm.umls.meta.SourceElement
SourceElement.BySourceComparator, SourceElement.BySourceRestrictor
 
Constructor Summary
CoocurrenceContextImpl()
          Instantiates an empty CoocurrenceContext.
CoocurrenceContextImpl(CoocurrenceContext cc)
          Instantiates a CoocurrenceContext from the specified CoocurrenceContext.
 
Method Summary
 void addQualifier(QualifierFrequency qual)
          Adds the specified QualifierFrequency.
 void clearQualifiers()
          Removes all QualifierFrequencys.
 int compareTo(Object o)
          Compares this Source to another one.
 boolean equals(Object o)
          Returns true if the specified object is equal to this object.
 int getCof()
          Shorthand for getCoocurrenceContextFrequency().
 ContentView getContentView()
          Returns tbe ContentView definition for this CoocurrenceContext (CVF).
 int getCoocurrenceContextFrequency()
          Returns the CoocurrenceContext frequency (COF).
 CoocurrenceGroup getCoocurrenceGroup()
          Returns the CoocurrenceGroup that holds this CoocurrenceContext.
 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.
 Source getSource()
          Returns the source for this CoocurrenceContext.
 int hashCode()
          Return a hash code based on key fields.
 void removeQualifier(QualifierFrequency qual)
          Removes the specified QualifierFrequency.
 void setCof(int cof)
          Shorthand for setCoocurrenceContextFrequency(int).
 void setContentView(ContentView cvf)
          Sets tbe ContentView definition for this CoocurrenceContext (CVF).
 void setCoocurrenceContextFrequency(int cof)
          Sets the CoocurrenceContext frequency (COF).
 void setCoocurrenceGroup(CoocurrenceGroup group)
          Sets the CoocurrenceGroup that holds this CoocurrenceContext.
 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 quals)
          Replaces the QualifierFrequency values with those in the specified List
 void setQualifiers(QualifierFrequency[] quals)
          Replaces the QualifierFrequency values with those in the specified array.
 void setSource(Source source)
          Sets the source for this CoocurrenceContext.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoocurrenceContextImpl

public CoocurrenceContextImpl()
Instantiates an empty CoocurrenceContext.


CoocurrenceContextImpl

public CoocurrenceContextImpl(CoocurrenceContext cc)
Instantiates a CoocurrenceContext from the specified CoocurrenceContext.

Parameters:
cc - CoocurrenceContext to be copied
Method Detail

getCoocurrenceGroup

public CoocurrenceGroup getCoocurrenceGroup()
Returns the CoocurrenceGroup that holds this CoocurrenceContext.

Specified by:
getCoocurrenceGroup in interface CoocurrenceContext
Returns:
the CoocurrenceGroup that holds this CoocurrenceContext

setCoocurrenceGroup

public void setCoocurrenceGroup(CoocurrenceGroup group)
Sets the CoocurrenceGroup that holds this CoocurrenceContext.

Specified by:
setCoocurrenceGroup in interface CoocurrenceContext
Parameters:
group - the CoocurrenceGroup that holds this CoocurrenceContext

getCoocurrenceType

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

Specified by:
getCoocurrenceType in interface CoocurrenceContext
Returns:
the CoocurrenceType

getCot

public CoocurrenceType getCot()
Shorthand for getCoocurrenceType().

Specified by:
getCot in interface CoocurrenceContext
Returns:
the CoocurrenceType

setCoocurrenceType

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

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

setCot

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

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

getCoocurrenceContextFrequency

public int getCoocurrenceContextFrequency()
Returns the CoocurrenceContext frequency (COF).

Specified by:
getCoocurrenceContextFrequency in interface CoocurrenceContext
Returns:
the CoocurrenceContext frequency

getCof

public int getCof()
Shorthand for getCoocurrenceContextFrequency().

Specified by:
getCof in interface CoocurrenceContext
Returns:
the CoocurrenceContext frequency

setCoocurrenceContextFrequency

public void setCoocurrenceContextFrequency(int cof)
Sets the CoocurrenceContext frequency (COF).

Specified by:
setCoocurrenceContextFrequency in interface CoocurrenceContext
Parameters:
cof - the CoocurrenceContext frequency

setCof

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

Specified by:
setCof in interface CoocurrenceContext
Parameters:
cof - the CoocurrenceContext frequency

getQualifiers

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

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

getQualifierAsList

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

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

setQualifiers

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

Specified by:
setQualifiers in interface CoocurrenceContext
Parameters:
quals - an array of QualifierFrequency values

setQualifiers

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

Specified by:
setQualifiers in interface CoocurrenceContext
Parameters:
quals - a List of QualifierFrequency values

addQualifier

public void addQualifier(QualifierFrequency qual)
Adds the specified QualifierFrequency.

Specified by:
addQualifier in interface CoocurrenceContext
Parameters:
qual - the QualifierFrequency to be added

removeQualifier

public void removeQualifier(QualifierFrequency qual)
Removes the specified QualifierFrequency.

Specified by:
removeQualifier in interface CoocurrenceContext
Parameters:
qual - the QualifierFrequency to be removed

clearQualifiers

public void clearQualifiers()
Removes all QualifierFrequencys.

Specified by:
clearQualifiers in interface CoocurrenceContext

getSource

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

Specified by:
getSource in interface SourceElement
Returns:
Source

setSource

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

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

getContentView

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

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

setContentView

public void setContentView(ContentView cvf)
Sets tbe ContentView definition for this CoocurrenceContext (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 CoocurrenceContext
Returns:
a String composed from the cot and versioned source.

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 CoocurrenceContext 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 Source 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