gov.nih.nlm.umls.meta
Class TermTypeGroup

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

public final class TermTypeGroup
extends AbstractExpandedForm

Represents a grouping of TermTypes. This class ensures that each unique TermType group is represented by a singleton object. In order for this to work correctly, the class must be properly initialized and must be initialized after Term Types is initialized.

Author:
Brian Carlsen, Deborah Shapiro

Constructor Summary
TermTypeGroup()
          Instantiates an empty TermTypeGroup.
 
Method Summary
 String getAbbreviation()
          Returns the abbreviation.
 String getDescription()
          Returns the description
static TermTypeGroup getTermTypeGroup(String tty_group)
          Returns the TermTypeGroup for the specified abbreviation.
static TermTypeGroup[] getTermTypeGroups()
          Return all TermTypeGroups.
static TermTypeGroup[] getTermTypeGroups(TermType tty)
          Return all TermTypeGroups for which the given TermType is a member.
static List getTermTypeGroupsAsList()
          Return all TermTypeGroups as a List.
static List getTermTypeGroupsAsList(TermType tty)
          Return all TermTypeGroups for which the given TermType is a member as a List.
 TermType[] getTermTypes()
          Return all TermTypes in this TermTypeGroup.
 List getTermTypesAsList()
          Return all TermTypes in this TermTypeGroup as a List.
static void initialize(List meta_dsc)
          Initializes the Map used to track all of the TermTypeGroups that exist at one time.
static void initialize(MetaDescription[] meta_dsc)
          Initializes the Map used to track all of the TermTypeGroups 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

TermTypeGroup

public TermTypeGroup()
Instantiates an empty TermTypeGroup.

Method Detail

initialize

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

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

initialize

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

Parameters:
meta_dsc - an array of MetaDescriptions

getTermTypeGroup

public static TermTypeGroup getTermTypeGroup(String tty_group)
Returns the TermTypeGroup 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:
tty_group - the term type abbreviation to look up
Returns:
the TermTypeGroup for the specified abbreviation

getTermTypeGroups

public static TermTypeGroup[] getTermTypeGroups(TermType tty)
Return all TermTypeGroups for which the given TermType is a member.

Parameters:
tty - TermType
Returns:
an array of TermTypeGroups

getTermTypeGroupsAsList

public static List getTermTypeGroupsAsList(TermType tty)
Return all TermTypeGroups for which the given TermType is a member as a List.

Parameters:
tty - TermType
Returns:
all TermTypeGroups as a List

getTermTypeGroups

public static TermTypeGroup[] getTermTypeGroups()
Return all TermTypeGroups.

Returns:
an array of TermTypeGroups

getTermTypeGroupsAsList

public static List getTermTypeGroupsAsList()
Return all TermTypeGroups as a List.

Returns:
all TermTypeGroups as a List

getTermTypes

public TermType[] getTermTypes()
Return all TermTypes in this TermTypeGroup.

Returns:
an array of TermTypeGroups

getTermTypesAsList

public List getTermTypesAsList()
Return all TermTypes in this TermTypeGroup as a List.

Returns:
all TermTypes 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