gov.nih.nlm.umls.meta
Class Source

java.lang.Object
  extended bygov.nih.nlm.umls.meta.Source
All Implemented Interfaces:
Comparable, SourceMetaDescription

public final class Source
extends Object
implements SourceMetaDescription

Represents a UMLS source. This class ensures that each unique source is represented by a singleton object. In order for this to work correctly, the class must be properly initialized.

Author:
Brian Carlsen, Deborah Shapiro

Constructor Summary
Source()
          Instantiates an empty Source.
 
Method Summary
 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.
 String getAtnl()
          Returns the attribute names as a comma (,) separated list of attribute name abbreviations (ATNL).
 AttributeName[] getAttributeNames()
          Get the AttributeNames for this Source.
 List getAttributeNamesAsList()
          Returns the AttributeNames as a List.
 String getAttributeNamesAsString()
          Returns the attribute names as a comma (,) separated list of attribute name abbreviations (ATNL).
 String getCenc()
          Returns the ISO character encoding (CENC).
 int getCfr()
          Returns the frequency of concepts (CFR).
 String getCharacterEncoding()
          Returns the ISO character encoding (CENC).
 String getCitation()
          Returns the citation information (SCIT).
 int getConceptFrequency()
          Returns the frequency of concepts (CFR).
 String getContentContact()
          Returns the content contact information (SCC).
 String getContextType()
          Returns the context type (CXTY).
 String getCurver()
          Returns the "is current version" value (CURVER).
 String getCxty()
          Returns the context type (CXTY).
 String getImeta()
          Returns the version of the Metathesaurus in which this source first appeared (IMETA).
 String getInsertMetaVersion()
          Returns the version of the Metathesaurus in which this source first appeared (IMETA).
 Language getLanguage()
          Returns the Language (LAT).
 Language getLat()
          Returns the Language (LAT).
 String getLicenseContact()
          Returns the license contact information (SLC).
 Date getMend()
          Returns the date when this source is no longer valid in the Metathesaurus (MEND).
 Date getMstart()
          Returns the date when this source becomes valid in the Metathesaurus (MSTART).
 String getOfficialName()
          Returns the source official name (SON).
 String getRcui()
          Returns the concept identifier for the root SRC concept (VCUI).
 String getRemoveMetaVersion()
          Returns the first version of the Metathesaurus in which this source no longer (RMETA).
 String getRestrictionLevel()
          Returns the restriction level (SRL).
 String getRmeta()
          Returns the first version of the Metathesaurus in which this source no longer (RMETA).
 String getRootConceptIdentifier()
          Returns the concept identifier for the root SRC concept (VCUI).
 String getRootSourceAbbreviation()
          Returns the root source abbreviation (RSAB).
 String getRsab()
          Returns the root source abbreviation (RSAB).
 String getSabin()
          Returns the "in current subset" value (SABIN).
 String getScc()
          Returns the content contact information (SCC).
 String getScit()
          Returns the citation information (SCIT).
 String getSf()
          Returns the source family (SF).
 String getShortName()
          Returns the source short name (SSN).
 String getSlc()
          Returns the license contact information (SLC).
 String getSon()
          Returns the source official name (SON).
static Source getSource(String sab)
          Returns the Source for the specified versioned source abbreviation.
 String getSourceFamily()
          Returns the source family (SF).
static Source[] getSources()
          Returns all Sources.
static List getSourcesAsList()
          Returns all Sources as a List.
static List getSourcesForFamily(String family)
          Returns the list of Sources for a specified source family.
static Set getSourcesForFamilyAsSet(String family)
          Returns the set of Sources for a specified source family.
 String getSrl()
          Returns the restriction level (SRL).
 String getSsn()
          Returns the source short name (SSN).
 String getSver()
          Returns source version (SVER).
 int getTermFrequency()
          Returns the frequency of terms (TFR).
 TermType[] getTermTypes()
          Returns the TermTypes.
 List getTermTypesAsList()
          Returns the TermTypes as a List.
 String getTermTypesAsString()
          Returns the term types as a comma (,) separated list of term type abbreviations (TTYL).
 int getTfr()
          Returns the frequency of terms (TFR).
 String getTtyl()
          Returns the term types as a comma (,) separated list of term type abbreviations (TTYL).
 Date getValidEndDate()
          Returns the date when this source is no longer valid in the Metathesaurus (MEND).
 Date getValidStartDate()
          Returns the date when this source becomes valid in the Metathesaurus (MSTART).
 String getVcui()
          Returns the concept identifier for the versioned SRC concept (VCUI).
 String getVersion()
          Returns source version (SVER).
 String getVersionedConceptIdentifier()
          Returns the concept identifier for the versioned SRC concept (VCUI).
 String getVersionedSourceAbbreviation()
          Returns the versioned source abbreviation (VSAB).
 String getVsab()
          Returns the versioned source abbreviation (VSAB).
 int hashCode()
          Return a hash code based on key fields.
 boolean inCurrentSubset()
          Indicates whether or not this source is represented in the current subset.
static void initialize(List meta_dsc)
          Initializes the Map used to track all of the Sources that exist at one time.
static void initialize(SourceMetaDescription[] meta_dsc)
          Initializes the Map used to track all of the Sources that exist at one time.
 boolean isCurrentVersion()
          Indicates whether or not this represents the current version of the source.
 void setInCurrentSubset(boolean sabin)
          Sets whether or not this represents the current version of the source.
 void setSabin(String sabin)
          Sets the "in current subset" value (SABIN).
 String toString()
          Returns the versioned source abbreviation (VSAB).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Source

public Source()
Instantiates an empty Source.

Method Detail

initialize

public static void initialize(SourceMetaDescription[] meta_dsc)
Initializes the Map used to track all of the Sources that exist at one time.

Parameters:
meta_dsc - an array of SourceMetaDescriptions

initialize

public static void initialize(List meta_dsc)
Initializes the Map used to track all of the Sources that exist at one time. This is implemented as a call to initialize(SourceMetaDescription[]).

Parameters:
meta_dsc - an array of SourceMetaDescriptions
Throws:
IllegalStateException - if an attempt is made to call this method more than once

getSource

public static Source getSource(String sab)
Returns the Source for the specified versioned source abbreviation. This method will return null if the initialize method has not been called or if the specified abbreviation was not one of those used during initialization.

Parameters:
sab - the specified versioned or versionless source abbreviation
Returns:
the Source for the specified abbreviation

getSources

public static Source[] getSources()
Returns all Sources.

Returns:
an array of Source

getSourcesAsList

public static List getSourcesAsList()
Returns all Sources as a List.

Returns:
all Sources as a List

getVcui

public String getVcui()
Returns the concept identifier for the versioned SRC concept (VCUI). This is shorthand for getVersionedConceptIdentifier().

Specified by:
getVcui in interface SourceMetaDescription
Returns:
the concept identifier for the versioned SRC concept

getVersionedConceptIdentifier

public String getVersionedConceptIdentifier()
Returns the concept identifier for the versioned SRC concept (VCUI).

Specified by:
getVersionedConceptIdentifier in interface SourceMetaDescription
Returns:
the concept identifier for the versioned SRC concept

getRcui

public String getRcui()
Returns the concept identifier for the root SRC concept (VCUI). This is shorthand for getRootConceptIdentifier().

Specified by:
getRcui in interface SourceMetaDescription
Returns:
the concept identifier for the root SRC concept

getRootConceptIdentifier

public String getRootConceptIdentifier()
Returns the concept identifier for the root SRC concept (VCUI).

Specified by:
getRootConceptIdentifier in interface SourceMetaDescription
Returns:
the concept identifier for the root SRC concept

getVsab

public String getVsab()
Returns the versioned source abbreviation (VSAB). This is shorthand for (@ link #getVersionedSourceAbbreviation()}.

Specified by:
getVsab in interface SourceMetaDescription
Returns:
the versioned source abbreviation

getVersionedSourceAbbreviation

public String getVersionedSourceAbbreviation()
Returns the versioned source abbreviation (VSAB).

Specified by:
getVersionedSourceAbbreviation in interface SourceMetaDescription
Returns:
the versioned source abbreviation

getRsab

public String getRsab()
Returns the root source abbreviation (RSAB). This is shorthand for getRootSourceAbbreviation().

Specified by:
getRsab in interface SourceMetaDescription
Returns:
the root source abbreviation

getRootSourceAbbreviation

public String getRootSourceAbbreviation()
Returns the root source abbreviation (RSAB).

Specified by:
getRootSourceAbbreviation in interface SourceMetaDescription
Returns:
the root source abbreviation

getSon

public String getSon()
Returns the source official name (SON). This is shorthand for getOfficialName().

Specified by:
getSon in interface SourceMetaDescription
Returns:
the source official name

getOfficialName

public String getOfficialName()
Returns the source official name (SON).

Specified by:
getOfficialName in interface SourceMetaDescription
Returns:
the source official name

getSsn

public String getSsn()
Returns the source short name (SSN). This is shorthand for getShortName().

Specified by:
getSsn in interface SourceMetaDescription
Returns:
the source short name

getShortName

public String getShortName()
Returns the source short name (SSN).

Specified by:
getShortName in interface SourceMetaDescription
Returns:
the source short name

getSf

public String getSf()
Returns the source family (SF). This is shorthand for getSourceFamily().

Specified by:
getSf in interface SourceMetaDescription
Returns:
the source family

getSourceFamily

public String getSourceFamily()
Returns the source family (SF).

Specified by:
getSourceFamily in interface SourceMetaDescription
Returns:
the source family

getSver

public String getSver()
Returns source version (SVER). This is shorthand for getVersion().

Specified by:
getSver in interface SourceMetaDescription
Returns:
the source version

getVersion

public String getVersion()
Returns source version (SVER).

Specified by:
getVersion in interface SourceMetaDescription
Returns:
the source version

getMstart

public Date getMstart()
Returns the date when this source becomes valid in the Metathesaurus (MSTART). This is shorthand for getValidStartDate().

Specified by:
getMstart in interface SourceMetaDescription
Returns:
the date when this source becomes valid in the Metathesaurus

getValidStartDate

public Date getValidStartDate()
Returns the date when this source becomes valid in the Metathesaurus (MSTART).

Specified by:
getValidStartDate in interface SourceMetaDescription
Returns:
the date when this source becomes valid in the Metathesaurus

getMend

public Date getMend()
Returns the date when this source is no longer valid in the Metathesaurus (MEND). This is shorthand for getValidEndDate().

Specified by:
getMend in interface SourceMetaDescription
Returns:
the date when this source is no longer valid in the Metathesaurus

getValidEndDate

public Date getValidEndDate()
Returns the date when this source is no longer valid in the Metathesaurus (MEND).

Specified by:
getValidEndDate in interface SourceMetaDescription
Returns:
the date when this source is no longer valid in the Metathesaurus

getImeta

public String getImeta()
Returns the version of the Metathesaurus in which this source first appeared (IMETA). This is shorthand for getInsertMetaVersion()

Specified by:
getImeta in interface SourceMetaDescription
Returns:
the version of the Metathesaurus in which this source first appeared

getInsertMetaVersion

public String getInsertMetaVersion()
Returns the version of the Metathesaurus in which this source first appeared (IMETA).

Specified by:
getInsertMetaVersion in interface SourceMetaDescription
Returns:
the version of the Metathesaurus in which this source first appeared

getRmeta

public String getRmeta()
Returns the first version of the Metathesaurus in which this source no longer (RMETA). This is shorthand for getRemoveMetaVersion()

Specified by:
getRmeta in interface SourceMetaDescription
Returns:
the first version of the Metathesaurus in which this source no longer

getRemoveMetaVersion

public String getRemoveMetaVersion()
Returns the first version of the Metathesaurus in which this source no longer (RMETA).

Specified by:
getRemoveMetaVersion in interface SourceMetaDescription
Returns:
the first version of the Metathesaurus in which this source no longer

getSlc

public String getSlc()
Returns the license contact information (SLC). This is shorthand for getLicenseContact().

Specified by:
getSlc in interface SourceMetaDescription
Returns:
the license contact information

getLicenseContact

public String getLicenseContact()
Returns the license contact information (SLC).

Specified by:
getLicenseContact in interface SourceMetaDescription
Returns:
the license contact information

getScit

public String getScit()
Returns the citation information (SCIT). This is shorthand for getCitation().

Specified by:
getScit in interface SourceMetaDescription
Returns:
the citation information

getCitation

public String getCitation()
Returns the citation information (SCIT).

Specified by:
getCitation in interface SourceMetaDescription
Returns:
the citation information

getContentContact

public String getContentContact()
Returns the content contact information (SCC). This is shorthand for getContentContact().

Specified by:
getContentContact in interface SourceMetaDescription
Returns:
the content contact information

getScc

public String getScc()
Returns the content contact information (SCC).

Specified by:
getScc in interface SourceMetaDescription
Returns:
the content contact information

getSrl

public String getSrl()
Returns the restriction level (SRL). This is shorthand for getRestrictionLevel().

Specified by:
getSrl in interface SourceMetaDescription
Returns:
the restriction level

getRestrictionLevel

public String getRestrictionLevel()
Returns the restriction level (SRL).

Specified by:
getRestrictionLevel in interface SourceMetaDescription
Returns:
the restriction level

getTfr

public int getTfr()
Returns the frequency of terms (TFR). This is shorthand for getTermFrequency()

Specified by:
getTfr in interface SourceMetaDescription
Returns:
the frequency of terms

getTermFrequency

public int getTermFrequency()
Returns the frequency of terms (TFR).

Specified by:
getTermFrequency in interface SourceMetaDescription
Returns:
the frequency of terms

getCfr

public int getCfr()
Returns the frequency of concepts (CFR). This is shorthand for getConceptFrequency()

Specified by:
getCfr in interface SourceMetaDescription
Returns:
the frequency of concepts

getConceptFrequency

public int getConceptFrequency()
Returns the frequency of concepts (CFR).

Specified by:
getConceptFrequency in interface SourceMetaDescription
Returns:
the frequency of concepts

getCxty

public String getCxty()
Returns the context type (CXTY). This is shorthand for getContextType().

Specified by:
getCxty in interface SourceMetaDescription
Returns:
the context type

getContextType

public String getContextType()
Returns the context type (CXTY).

Specified by:
getContextType in interface SourceMetaDescription
Returns:
the context type

getTermTypes

public TermType[] getTermTypes()
Returns the TermTypes.

Specified by:
getTermTypes in interface SourceMetaDescription
Returns:
an array of TermTypes

getTermTypesAsList

public List getTermTypesAsList()
Returns the TermTypes as a List.

Specified by:
getTermTypesAsList in interface SourceMetaDescription
Returns:
the TermTypes as a List

getTtyl

public String getTtyl()
Returns the term types as a comma (,) separated list of term type abbreviations (TTYL). This is shorthand for getTermTypesAsString().

Specified by:
getTtyl in interface SourceMetaDescription
Returns:
the term type values

getTermTypesAsString

public String getTermTypesAsString()
Returns the term types as a comma (,) separated list of term type abbreviations (TTYL).

Specified by:
getTermTypesAsString in interface SourceMetaDescription
Returns:
the term type values

getAttributeNames

public AttributeName[] getAttributeNames()
Get the AttributeNames for this Source. Returns the AttributeNames.

Specified by:
getAttributeNames in interface SourceMetaDescription
Returns:
an array of AttributeNames

getAttributeNamesAsList

public List getAttributeNamesAsList()
Returns the AttributeNames as a List.

Specified by:
getAttributeNamesAsList in interface SourceMetaDescription
Returns:
the AttributeNames as a List

getAtnl

public String getAtnl()
Returns the attribute names as a comma (,) separated list of attribute name abbreviations (ATNL). This is shorthand for getAttributeNamesAsString().

Specified by:
getAtnl in interface SourceMetaDescription
Returns:
the attribute name values

getAttributeNamesAsString

public String getAttributeNamesAsString()
Returns the attribute names as a comma (,) separated list of attribute name abbreviations (ATNL).

Specified by:
getAttributeNamesAsString in interface SourceMetaDescription
Returns:
the attribute name values

getLat

public Language getLat()
Returns the Language (LAT). This is shorthand for getLanguage().

Specified by:
getLat in interface SourceMetaDescription
Returns:
the Language

getLanguage

public Language getLanguage()
Returns the Language (LAT).

Specified by:
getLanguage in interface SourceMetaDescription
Returns:
the Language

getCenc

public String getCenc()
Returns the ISO character encoding (CENC). This is shorthand for getCharacterEncoding().

Specified by:
getCenc in interface SourceMetaDescription
Returns:
the character encoding

getCharacterEncoding

public String getCharacterEncoding()
Returns the ISO character encoding (CENC).

Specified by:
getCharacterEncoding in interface SourceMetaDescription
Returns:
the character encoding

getCurver

public String getCurver()
Returns the "is current version" value (CURVER).

Specified by:
getCurver in interface SourceMetaDescription
Returns:
the "is current version" value

isCurrentVersion

public boolean isCurrentVersion()
Indicates whether or not this represents the current version of the source.

Specified by:
isCurrentVersion in interface SourceMetaDescription
Returns:
true if it does, false otherwise.

getSabin

public String getSabin()
Returns the "in current subset" value (SABIN).

Specified by:
getSabin in interface SourceMetaDescription
Returns:
the "in current subset" value

setInCurrentSubset

public void setInCurrentSubset(boolean sabin)
Sets whether or not this represents the current version of the source.

Specified by:
setInCurrentSubset in interface SourceMetaDescription
Parameters:
sabin - boolean

setSabin

public void setSabin(String sabin)
Sets the "in current subset" value (SABIN).

Specified by:
setSabin in interface SourceMetaDescription
Parameters:
sabin - "in current subset" value

inCurrentSubset

public boolean inCurrentSubset()
Indicates whether or not this source is represented in the current subset.

Specified by:
inCurrentSubset in interface SourceMetaDescription
Returns:
true if it is, false otherwise.

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

getSourcesForFamily

public static List getSourcesForFamily(String family)
Returns the list of Sources for a specified source family.

Parameters:
family - a source family, e.g. MSH
Returns:
the List of Sources for a specified source family.

getSourcesForFamilyAsSet

public static Set getSourcesForFamilyAsSet(String family)
Returns the set of Sources for a specified source family.

Parameters:
family - a source family, e.g. MSH
Returns:
the Set of Sources for a specified source family.

toString

public String toString()
Returns the versioned source abbreviation (VSAB).

Returns:
the versioned source abbreviation


Copyright ©2005