gov.nih.nlm.umls.meta
Class HierarchicalSemanticType

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

public final class HierarchicalSemanticType
extends Object
implements Comparable, STYMetaDescription

Represents information about a semantic type in the semantic network. This class ensures that each unique hierarchical semantic type is represented by a singleton object. In order for this to work correctly, the class must be properly initialized. Data from the SRDEF file (STY rows) can be found here.

Author:
Brian Carlsen, Deborah Shapiro

Constructor Summary
HierarchicalSemanticType()
          Instantiates an empty HierarchicalSemanticType.
 
Method Summary
 boolean allowsNonHumanFlag()
          Indicates whether or not this semantic type or its descendents allow the non human flag.
 int compareTo(Object o)
          Compares this HierarchicalSemanticType to another one.
 boolean equals(Object o)
          Returns true if the specified object is equal to this object.
 String getDef()
          Returns the definition (DEF).
 String getDefinition()
          Returns the definition (DEF).
 String getEx()
          Returns a semi-colon (;) separated list of Metathesaurus strings (EX) which are examples of this semantic type.
 String[] getExamples()
          Returns a String array of of Metathesaurus strings (EX) which are examples of this semantic type.
 List getExamplesAsList()
          Returns a List array of of Metathesaurus strings (EX) which are examples of this semantic type.
 String getExamplesAsString()
          Returns a semi-colon (;) separated list of Metathesaurus strings (EX) which are examples of this semantic type.
static HierarchicalSemanticType getHierarchicalSemanticType(String name)
          Returns the HierarchicalSemanticType for the specified semantic type name.
static HierarchicalSemanticType[] getHierarchicalSemanticTypes()
          Return all HierarchicalSemanticTypes.
static List getHierarchicalSemanticTypesAsList()
          Return all HierarchicalSemanticTypes.
 String getIdentifier()
          Returns the unique identifier (UI).
 String getName()
          Returns the name (STY).
 String getNH()
          Returns the non human flag value (NH).
 String getStn()
          Returns the tree number (STN).
 String getSty()
          Returns the name (STY).
 String getTreeNumber()
          Returns the tree number (STN).
 String getUi()
          Returns the unique identifier (UI).
 String getUn()
          Returns the usage note (UN).
 String getUsageNote()
          Returns the usage note (UN).
 int hashCode()
          Return a hash code based on key fields.
static void initialize(List meta_dsc)
          Initializes the Map used to track all of the HierarchicalSemanticTypes that exist at one time.
static void initialize(STYMetaDescription[] meta_dsc)
          Initializes the Map used to track all of the HierarchicalSemanticTypes that exist at one time.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HierarchicalSemanticType

public HierarchicalSemanticType()
Instantiates an empty HierarchicalSemanticType.

Method Detail

initialize

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

Parameters:
meta_dsc - an array of STYMetaDescriptions

initialize

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

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

getHierarchicalSemanticType

public static HierarchicalSemanticType getHierarchicalSemanticType(String name)
Returns the HierarchicalSemanticType for the specified semantic type name. This method will return null if the initialize method has not been called or if the specified name was not one of those used during initialization.

Parameters:
name - the semantic type name to look up
Returns:
the HierarchicalSemanticType for the specified name

getHierarchicalSemanticTypes

public static HierarchicalSemanticType[] getHierarchicalSemanticTypes()
Return all HierarchicalSemanticTypes.

Returns:
an array of HierarchicalSemanticType

getHierarchicalSemanticTypesAsList

public static List getHierarchicalSemanticTypesAsList()
Return all HierarchicalSemanticTypes.

Returns:
a List of HierarchicalSemanticType

getUi

public String getUi()
Returns the unique identifier (UI). This is shorthand for getIdentifier().

Specified by:
getUi in interface STYMetaDescription
Returns:
the unique identifier

getIdentifier

public String getIdentifier()
Returns the unique identifier (UI).

Specified by:
getIdentifier in interface STYMetaDescription
Returns:
the unique identifier

getSty

public String getSty()
Returns the name (STY). This is shorthand for getName().

Specified by:
getSty in interface STYMetaDescription
Returns:
the name

getName

public String getName()
Returns the name (STY).

Specified by:
getName in interface STYMetaDescription
Returns:
the name

getStn

public String getStn()
Returns the tree number (STN). This is shorthand for getTreeNumber().

Specified by:
getStn in interface STYMetaDescription
Returns:
the tree number

getTreeNumber

public String getTreeNumber()
Returns the tree number (STN).

Specified by:
getTreeNumber in interface STYMetaDescription
Returns:
the tree number

getDef

public String getDef()
Returns the definition (DEF). This is shorthand for getDefinition().

Specified by:
getDef in interface STYMetaDescription
Returns:
the definition

getDefinition

public String getDefinition()
Returns the definition (DEF).

Specified by:
getDefinition in interface STYMetaDescription
Returns:
the definition

getEx

public String getEx()
Returns a semi-colon (;) separated list of Metathesaurus strings (EX) which are examples of this semantic type. This is shorthand for getExamplesAsString().

Specified by:
getEx in interface STYMetaDescription
Returns:
a value listing Metathesaurus examples

getExamples

public String[] getExamples()
Returns a String array of of Metathesaurus strings (EX) which are examples of this semantic type.

Specified by:
getExamples in interface STYMetaDescription
Returns:
an String array of Metathesaurus examples

getExamplesAsString

public String getExamplesAsString()
Returns a semi-colon (;) separated list of Metathesaurus strings (EX) which are examples of this semantic type. This is shorthand for getExamplesAsString().

Specified by:
getExamplesAsString in interface STYMetaDescription
Returns:
a value listing Metathesaurus examples

getExamplesAsList

public List getExamplesAsList()
Returns a List array of of Metathesaurus strings (EX) which are examples of this semantic type.

Specified by:
getExamplesAsList in interface STYMetaDescription
Returns:
an List of Metathesaurus examples

getUn

public String getUn()
Returns the usage note (UN). This is shorthand for getUsageNote().

Specified by:
getUn in interface STYMetaDescription
Returns:
the usage note

getUsageNote

public String getUsageNote()
Returns the usage note (UN).

Specified by:
getUsageNote in interface STYMetaDescription
Returns:
the usage note

allowsNonHumanFlag

public boolean allowsNonHumanFlag()
Indicates whether or not this semantic type or its descendents allow the non human flag.

Specified by:
allowsNonHumanFlag in interface STYMetaDescription
Returns:
true if allowed, false if not

getNH

public String getNH()
Returns the non human flag value (NH).

Specified by:
getNH in interface STYMetaDescription
Returns:
the non human flag value

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 HierarchicalSemanticType 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


Copyright ©2005