gov.nih.nlm.umls.meta
Class StringType

java.lang.Object
  extended bygov.nih.nlm.umls.meta.AbstractExpandedForm
      extended bygov.nih.nlm.umls.meta.StringType
All Implemented Interfaces:
Comparable, ExpandedForm

public final class StringType
extends AbstractExpandedForm

Represents an string type. This class ensures that each unique string type 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
StringType()
          Instantiates an empty StringType.
 
Method Summary
 String getAbbreviation()
          Returns the abbreviation.
 String getDescription()
          Returns the description
static StringType getStringType(String stt)
          Returns the StringType for the specified abbreviation.
static StringType[] getStringTypes()
          Returns all StringTypes.
static List getStringTypesAsList()
          Returns all StringTypes as a List.
static void initialize(List meta_dsc)
          Initializes the Map used to track all of the StringTypes that exist at one time.
static void initialize(MetaDescription[] meta_dsc)
          Initializes the Map used to track all of the StringTypes that exist at one time.
 
Methods inherited from class gov.nih.nlm.umls.meta.AbstractExpandedForm
compareTo, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringType

public StringType()
Instantiates an empty StringType.

Method Detail

initialize

public static void initialize(MetaDescription[] meta_dsc)
Initializes the Map used to track all of the StringTypes that exist at one time. You may pass all MetaDescriptions as this method only creates StringTypes for those with a type of "STT".

Parameters:
meta_dsc - an array of MetaDescriptions

initialize

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

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

getStringType

public static StringType getStringType(String stt)
Returns the StringType for the specified 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:
stt - the string type abbreviation to look up
Returns:
the StringType for the specified abbreviation

getStringTypes

public static StringType[] getStringTypes()
Returns all StringTypes.

Returns:
an array of StringType

getStringTypesAsList

public static List getStringTypesAsList()
Returns all StringTypes as a List.

Returns:
all StringTypes as a List

getAbbreviation

public String getAbbreviation()
Returns the abbreviation.

Returns:
the abbreviation

getDescription

public String getDescription()
Returns the description

Returns:
the description


Copyright ©2005