gov.nih.nlm.umls.meta
Class AttributeName

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

public final class AttributeName
extends AbstractExpandedForm

Represents an attribute name. This class ensures that each unique attribute name is represented by a singleton object. In order for this to work correctly, the class must be properly initialized, and it may be initialized only once.

Author:
Brian Carlsen, Deborah Shapiro

Constructor Summary
AttributeName()
          Instantiate an empty AttributeName.
 
Method Summary
 String getAbbreviation()
          Returns the abbreviation.
static AttributeName getAttributeName(String atn)
          Returns the AttributeName for the specified abbreviation.
static AttributeName[] getAttributeNames()
          Returns all AttributeNames.
static List getAttributeNamesAsList()
          Returns all AttributeNames as a List.
 String getDescription()
          Returns the description
static void initialize(List meta_dsc)
          Initializes the Map used to track all of the AttributeNames that exist at one time.
static void initialize(MetaDescription[] meta_dsc)
          Initializes the Map used to track all of the AttributeNames 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

AttributeName

public AttributeName()
Instantiate an empty AttributeName.

Method Detail

initialize

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

Parameters:
meta_dsc - an array of MetaDescriptions

initialize

public static void initialize(List meta_dsc)
Initializes the Map used to track all of the AttributeNames 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

getAttributeName

public static AttributeName getAttributeName(String atn)
Returns the AttributeName 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:
atn - the attribute name abbreviation to look up
Returns:
the AttributeName for the specified abbreviation

getAttributeNames

public static AttributeName[] getAttributeNames()
Returns all AttributeNames.

Returns:
an array of AttributeName

getAttributeNamesAsList

public static List getAttributeNamesAsList()
Returns all AttributeNames as a List.

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