gov.nih.nlm.umls.meta
Class MetaDescriptionInitializer

java.lang.Object
  extended by gov.nih.nlm.umls.meta.MetaDescriptionInitializer
All Implemented Interfaces:
LocalNullValueSupport

public final class MetaDescriptionInitializer
extends Object
implements LocalNullValueSupport

Provides an easy mechanism for initializing the system from MRDOC, MRSAB, and SRDEF. This is a convenience class to help users avoid the complexities of initializing an application.

Author:
Brian Carlsen, Deborah Shapiro

Field Summary
protected  boolean null_value_flag
           
protected  String regex_null_value
           
 
Constructor Summary
MetaDescriptionInitializer()
          Instantiates an empty MetaDescriptionInitializer.
 
Method Summary
 String getNullValue()
          Returns the null value.
 void initialize(File mrdoc, File mrsab, File srdef)
          Initializes any or all of the following files: MRDOC, MRSAB, SRDEF.
 void initialize(File mrdoc, File mrsab, File srdef, File sty_groups)
          Initializes any or all of the following files: MRDOC, MRSAB, SRDEF.
 void initialize(MetaDescription[] meta_dsc)
          Initializes all of the MetaDescriptions at one time.
 void initialize(SourceMetaDescription[] source_meta_dsc)
          Initializes all of the SourceMetaDescriptions at one time.
 void initialize(STYMetaDescription[] sty_meta_dsc)
          Initializes all of the STYMetaDescriptions at one time.
 boolean isEmptyValue(String token)
          Indicates whether or not the specified token is null or contains a null value as defined by being either zero length or a value equal to the null value.
protected  String resolveNull(String line)
          Replaces all "null value" characters in the line.
 void setNullValue(String null_value)
          Sets the null value to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

regex_null_value

protected String regex_null_value

null_value_flag

protected boolean null_value_flag
Constructor Detail

MetaDescriptionInitializer

public MetaDescriptionInitializer()
Instantiates an empty MetaDescriptionInitializer.

Method Detail

setNullValue

public void setNullValue(String null_value)
Sets the null value to use. This is needed if release.dat specifies some non-standard null value char sequence.

Specified by:
setNullValue in interface LocalNullValueSupport
Parameters:
null_value - the new null string value

getNullValue

public String getNullValue()
Returns the null value. This is needed if release.dat specifies some non-standard null value char sequence.

Specified by:
getNullValue in interface LocalNullValueSupport
Returns:
the string value for "null"

isEmptyValue

public boolean isEmptyValue(String token)
Indicates whether or not the specified token is null or contains a null value as defined by being either zero length or a value equal to the null value.

Specified by:
isEmptyValue in interface LocalNullValueSupport

initialize

public void initialize(MetaDescription[] meta_dsc)
Initializes all of the MetaDescriptions at one time.

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

initialize

public void initialize(STYMetaDescription[] sty_meta_dsc)
Initializes all of the STYMetaDescriptions at one time.

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

initialize

public void initialize(SourceMetaDescription[] source_meta_dsc)
Initializes all of the SourceMetaDescriptions at one time.

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

initialize

public void initialize(File mrdoc,
                       File mrsab,
                       File srdef)
                throws IOException
Initializes any or all of the following files: MRDOC, MRSAB, SRDEF. BAckwards compatability.

Parameters:
mrdoc - File MRDOC
mrsab - File MRSAB
srdef - File SRDEF
Throws:
IOException

initialize

public void initialize(File mrdoc,
                       File mrsab,
                       File srdef,
                       File sty_groups)
                throws IOException
Initializes any or all of the following files: MRDOC, MRSAB, SRDEF.

Parameters:
mrdoc - File MRDOC
mrsab - File MRSAB
srdef - File SRDEF
sty_groups - File SemGroups.txt
Throws:
IOException

resolveNull

protected String resolveNull(String line)
Replaces all "null value" characters in the line.

Parameters:
line - input line
Returns:
output line


Copyright ©2005