gov.nih.nlm.mms
Interface ConceptInputStream


public interface ConceptInputStream

This interface defines an API for reading Concepts from some input source. This source can be MR Files, update MR Files, a database, or pretty much anything else.

Author:
Deborah Shapiro

Method Summary
 void close()
          Closes the input stream.
 int getConceptProgress()
          Return an int between 0 and 100 indicating how far along the input stream is in reading Concepts.
 String getConfigurationDetails()
          Returns a String describing the configuration details.
 int getIndexProgress()
          Return an int between 0 and 100 indicating how far along the input stream is in reading IndexEntry elements.
 String getName()
          Returns a descriptive, yet short, name of the input stream for display purposes.
 void open(String input_loc)
          Opens the input stream.
 Concept readConcept()
          Read a Concept from the input stream and return it.
 IndexEntry readIndexEntry()
          Read an IndexEntry from the input stream and return it.
 ReleaseMetadata readReleaseMetadata()
          Read the ReleaseMetadata from the input stream and return it.
 void setConfiguration(UserConfiguration config)
          Sets the UserConfiguration.
 void setCuiList(CuiList cui_list)
          Provides input stream access to the cui list.
 

Method Detail

getName

public String getName()
Returns a descriptive, yet short, name of the input stream for display purposes. This name is to be used when prompting the user for what input stream they would like to use.

Returns:
a short name of the input stream for display purposes.

setConfiguration

public void setConfiguration(UserConfiguration config)
Sets the UserConfiguration. In certain cases, input streams may require information provided by the application configuration.

Parameters:
config - the UserConfiguration

open

public void open(String input_loc)
          throws Exception
Opens the input stream. Here is where the actual files containing the Metathesaurus data should be opened.

Parameters:
input_loc - locator information for the input stream
Throws:
Exception - if there is a problem opening files

close

public void close()
           throws Exception
Closes the input stream. Here is where the actual files containing the Metathesaurus data should be closed.

Throws:
Exception - if there is a problem closing files

readConcept

public Concept readConcept()
                    throws Exception
Read a Concept from the input stream and return it. This method should provide the mapping between the input files and Concept objects. Furthermore, it should be implemented like a stream, in the sense that only the content for the next Concept should be read into memory.

Returns:
a Concept read from the input stream
Throws:
Exception - if there is a problem reading the concept

readIndexEntry

public IndexEntry readIndexEntry()
                          throws Exception
Read an IndexEntry from the input stream and return it. This method should provide the mapping between the input files and IndexEntry objects. Futhermore, it should be implemented like a stream, in the sense that only the content for the next IndexEntry should be read into memory.

Returns:
an IndexEntry
Throws:
Exception - if there is a problem reading the index entry

readReleaseMetadata

public ReleaseMetadata readReleaseMetadata()
                                    throws Exception
Read the ReleaseMetadata from the input stream and return it.

Returns:
ReleaseMetadata
Throws:
Exception - if there is a problem reading the release metadata

getConceptProgress

public int getConceptProgress()
Return an int between 0 and 100 indicating how far along the input stream is in reading Concepts. This information can be used for a progress monitor.

Returns:
int representing percentage complete

getIndexProgress

public int getIndexProgress()
Return an int between 0 and 100 indicating how far along the input stream is in reading IndexEntry elements. This information can be used for a progress monitor.

Returns:
int representing percentage complete

getConfigurationDetails

public String getConfigurationDetails()
Returns a String describing the configuration details. This is a mechanism for the input stream to write details of its operation to the log file that MetamorphoSys eventually produces.

Returns:
a String describing the configuration details

setCuiList

public void setCuiList(CuiList cui_list)
Provides input stream access to the cui list.

Parameters:
cui_list - CuiList


Copyright ©2005