gov.nih.nlm.umls.meta
Class SemanticTypeGroup

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

public final class SemanticTypeGroup
extends AbstractExpandedForm

Represents a grouping of SemanticTypes. This class ensures that each unique SemanticType 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
SemanticTypeGroup()
          Instantiates an empty SemanticTypeGroup.
 
Method Summary
 String getAbbreviation()
          Returns the abbreviation.
 String getDescription()
          Returns the description
static SemanticTypeGroup getSemanticTypeGroup(String sty_group)
          Returns the SemanticTypeGroup for the specified abbreviation.
static SemanticTypeGroup[] getSemanticTypeGroups()
          Return all SemanticTypeGroups.
static SemanticTypeGroup[] getSemanticTypeGroups(SemanticType sty)
          Return all SemanticTypeGroups for which the given SemanticType is a member.
static List getSemanticTypeGroupsAsList()
          Return all SemanticTypeGroups as a List.
static List getSemanticTypeGroupsAsList(SemanticType sty)
          Return all SemanticTypeGroups for which the given SemanticType is a member as a List.
 SemanticType[] getSemanticTypes()
          Return all SemanticTypes in this SemanticTypeGroup.
 List getSemanticTypesAsList()
          Return all SemanticTypes in this SemanticTypeGroup as a List.
static void initialize(List meta_dsc)
          Initializes the Map used to track all of the SemanticTypeGroups that exist at one time.
static void initialize(MetaDescription[] meta_dsc)
          Initializes the Map used to track all of the SemanticTypeGroups 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

SemanticTypeGroup

public SemanticTypeGroup()
Instantiates an empty SemanticTypeGroup.

Method Detail

initialize

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

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 SemanticTypeGroups that exist at one time. This is implemented as a call to initialize(MetaDescription[]).

Parameters:
meta_dsc - an array of MetaDescriptions

getSemanticTypeGroup

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

getSemanticTypeGroups

public static SemanticTypeGroup[] getSemanticTypeGroups(SemanticType sty)
Return all SemanticTypeGroups for which the given SemanticType is a member.

Parameters:
sty - SemanticType
Returns:
an array of SemanticTypeGroups

getSemanticTypeGroupsAsList

public static List getSemanticTypeGroupsAsList(SemanticType sty)
Return all SemanticTypeGroups for which the given SemanticType is a member as a List.

Parameters:
sty - SemanticType
Returns:
all SemanticTypeGroups as a List

getSemanticTypeGroups

public static SemanticTypeGroup[] getSemanticTypeGroups()
Return all SemanticTypeGroups.

Returns:
an array of SemanticTypeGroups

getSemanticTypeGroupsAsList

public static List getSemanticTypeGroupsAsList()
Return all SemanticTypeGroups as a List.

Returns:
all SemanticTypeGroups as a List

getSemanticTypes

public SemanticType[] getSemanticTypes()
Return all SemanticTypes in this SemanticTypeGroup.

Returns:
an array of SemanticTypeGroups

getSemanticTypesAsList

public List getSemanticTypesAsList()
Return all SemanticTypes in this SemanticTypeGroup as a List.

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