gov.nih.nlm.mms.browser
Interface BrowsableInputStream

All Superinterfaces:
LocalNullValueSupport
All Known Implementing Classes:
RRFBrowsableInputStream

public interface BrowsableInputStream
extends LocalNullValueSupport

Interface to separate knowledge of the input format from the retrieval of objects in the object model, allowing various different data formats to be loaded into the browser. Use this interface instead of UserConfiguration or ApplicationConfiguration references.


Method Summary
 void buildIndexes(ProgressMonitor pm)
          Builds the indexes in the BrowsableInputStream.
 boolean buildIndexesNeeded()
          Indicates if indexes in the BrowsableInputStream need to be built.
 void close()
          Closes the BrowsableInputStream.
 boolean containsConcept(String cui)
          Indicates if the BrowsableInputStream contains the concept specified by the CUI.
 int countChildren(Context context)
          Returns the number of children for the given Context.
 int countSiblings(Context context)
          Returns the number of siblings for the given Context.
 boolean directoryContainsExpectedData()
          Indicates if directory of BrowsableInputStream contains the expected data for its type.
 Atom[] findAtomsByCodeSab(String code, Set sources)
          Looks up the given code in the CODE_SAB_MRCONSO.x index file and returns the Atom[] of Atoms that have the given code and that are in any of the given Sources.
 Context[] findChildren(Context context, SearchOptions options)
          Returns a Context[] of children for the given context.
 Context[] findSiblings(Context context, SearchOptions options)
          Returns a Context[] of siblings for the given context.
 Set findWordMatches(String word, Language language)
          Finds WordSearchResults of Concepts with Strings containing the specified word.
 Color getColor()
          Returns the name of the color associated with this input format.
 String getDirectory()
          Gets directory of BrowsableInputStream.
 String getName()
          Returns the name of the Input Format.
 List getPrecedenceOrder()
          Returns a list of SourceTermTypes
 String[] getPreexpandedRawFiles()
          Returns list of file names that should be preexpanded to show user initial content when concepts are first opened in browser.
 Map getRawConceptWithLinks(String cui, LinkGenerator link_gen)
          Returns a Map that has concept data filename String objects as keys and have String[] values which are the lines in the file matching the specified CUI.
 Map getRawHistoryData(String cui)
          Returns a Map that has history filename String objects as keys and have String[] values which are the lines of the file that are relevant to the query.
 Map getRawMetadata()
          Returns a Map that has metadata filename String objects as keys and have String[] values which are the lines of the file that are relevant to the query.
 String getReleaseVersion()
          Returns the release version
 List getSourceList()
          Returns a list of Sources
 int getWordFrequency(String word, Language language)
          Gets number of strings in which a word appears.
 boolean hasChildren(Context context)
          Indicates if given Context has children.
 boolean hasSiblings(Context context)
          Indicates if the given Context has siblings.
 void initializeMetadata()
          Initializes metadata.
 void open()
          Opens the BrowsableInputStream.
 Atom readAtom(String aui, AtomDataSelector selector)
          Looks up the given AUI in the index file and returns the Atom that contains the given AUI.
 Concept readConcept(String cui, ConceptDataSelector selector)
          Populates a Concept with the amount of information specified by a ConceptDataSelector.
 ReleaseMetadata readReleaseMetadata()
          Returns the ReleaseMetadata containing data from the BrowsableInputStream files.
 void setDirectory(String newDirectory)
          Sets directory of BrowsableInputStream.
 
Methods inherited from interface gov.nih.nlm.util.LocalNullValueSupport
getNullValue, isEmptyValue, setNullValue
 

Method Detail

getDirectory

String getDirectory()
Gets directory of BrowsableInputStream.

Returns:
directory of BrowsableInputStream.

setDirectory

void setDirectory(String newDirectory)
Sets directory of BrowsableInputStream.

Parameters:
newDirectory - directory of BrowsableInputStream

directoryContainsExpectedData

boolean directoryContainsExpectedData()
Indicates if directory of BrowsableInputStream contains the expected data for its type.

Returns:
true if the directory set by setDirectory(String) contains the expected data, otherwise false.

open

void open()
          throws IOException
Opens the BrowsableInputStream.

Throws:
IOException - if there is a problem opening the BrowsableInputStream.

close

void close()
           throws IOException
Closes the BrowsableInputStream.

Throws:
IOException - if there is a problem closing the BrowsableInputStream.

initializeMetadata

void initializeMetadata()
                        throws IOException
Initializes metadata.

Throws:
IOException

readReleaseMetadata

ReleaseMetadata readReleaseMetadata()
                                    throws IOException
Returns the ReleaseMetadata containing data from the BrowsableInputStream files.

Returns:
the ReleaseMetadata
Throws:
IOException - if the files could not be read.

buildIndexesNeeded

boolean buildIndexesNeeded()
Indicates if indexes in the BrowsableInputStream need to be built.

Returns:
true if indexes needed to be built; false otherwise.

buildIndexes

void buildIndexes(ProgressMonitor pm)
                  throws IOException
Builds the indexes in the BrowsableInputStream.

Parameters:
pm - ProgressMonitor for displaying progress of the operation
Throws:
IOException

getPrecedenceOrder

List getPrecedenceOrder()
Returns a list of SourceTermTypes

Returns:
List

getSourceList

List getSourceList()
Returns a list of Sources

Returns:
List

getName

String getName()
Returns the name of the Input Format.

Returns:
input format name

getColor

Color getColor()
Returns the name of the color associated with this input format.

Returns:
input format color

getReleaseVersion

String getReleaseVersion()
Returns the release version

Returns:
release version

readConcept

Concept readConcept(String cui,
                    ConceptDataSelector selector)
                    throws IOException
Populates a Concept with the amount of information specified by a ConceptDataSelector.

Parameters:
cui - CUI (concept unique identifier) of the Concept desired
selector - ConceptDataSelector
Returns:
a populated Concept according to the specified ConceptDataSelector.
Throws:
IOException

readAtom

Atom readAtom(String aui,
              AtomDataSelector selector)
              throws IOException
Looks up the given AUI in the index file and returns the Atom that contains the given AUI.

Parameters:
aui - AUI to be searched for
selector - AtomDataSelector specifying how to populate the Atom
Returns:
the Atom containing the AUI, populated according to the AtomDataSelector.
Throws:
IOException

getRawConceptWithLinks

Map getRawConceptWithLinks(String cui,
                           LinkGenerator link_gen)
                           throws IOException
Returns a Map that has concept data filename String objects as keys and have String[] values which are the lines in the file matching the specified CUI.

Parameters:
cui - UMLS CUI
link_gen - link generator
Returns:
a Map from each input stream file name to an array of the lines in that file matching the specified CUI.
Throws:
IOException

getRawHistoryData

Map getRawHistoryData(String cui)
                      throws IOException
Returns a Map that has history filename String objects as keys and have String[] values which are the lines of the file that are relevant to the query.

Parameters:
cui - UMLS CUI
Returns:
a Map that has history filename String objects as keys and have String[] values which are the lines of the file that are relevant to the query.
Throws:
IOException

getRawMetadata

Map getRawMetadata()
                   throws IOException
Returns a Map that has metadata filename String objects as keys and have String[] values which are the lines of the file that are relevant to the query.

Returns:
a Map that has metadata filename String objects as keys and have String[] values which are the lines of the file that are relevant to the query.
Throws:
IOException

containsConcept

boolean containsConcept(String cui)
                        throws IOException
Indicates if the BrowsableInputStream contains the concept specified by the CUI.

Parameters:
cui - CUI of the concept in question
Returns:
true if the data set contains the concept specified by the CUI.
Throws:
IOException

countSiblings

int countSiblings(Context context)
                  throws IOException
Returns the number of siblings for the given Context.

Parameters:
context -
Returns:
number of siblings
Throws:
IOException

hasSiblings

boolean hasSiblings(Context context)
                    throws IOException
Indicates if the given Context has siblings.

Parameters:
context -
Returns:
true if context has siblings false otherwise
Throws:
IOException

findSiblings

Context[] findSiblings(Context context,
                       SearchOptions options)
                       throws IOException
Returns a Context[] of siblings for the given context.

Parameters:
context -
options - SearchOptions specify parameters
Returns:
array of siblings
Throws:
IOException

countChildren

int countChildren(Context context)
                  throws IOException
Returns the number of children for the given Context.

Parameters:
context -
Returns:
count of children
Throws:
IOException

hasChildren

boolean hasChildren(Context context)
                    throws IOException
Indicates if given Context has children.

Parameters:
context -
Returns:
true if context has children false otherwise
Throws:
IOException

findChildren

Context[] findChildren(Context context,
                       SearchOptions options)
                       throws IOException
Returns a Context[] of children for the given context.

Parameters:
context -
options - SearchOptions specify parameters
Returns:
Context[]
Throws:
IOException

findWordMatches

Set findWordMatches(String word,
                    Language language)
                    throws IOException,
                           InterruptedException
Finds WordSearchResults of Concepts with Strings containing the specified word.

Parameters:
word - search word or partial search word with wild card '*' at end
language - Language of strings to be found
Returns:
Set of WordSearchResults consisting of matches on the specified word.
Throws:
IOException
InterruptedException

getWordFrequency

int getWordFrequency(String word,
                     Language language)
                     throws IOException
Gets number of strings in which a word appears.

Parameters:
word - word or partial word followed by a wild card character '*'.
language - Language of strings to search
Returns:
number of strings in which a word appears.
Throws:
IOException

findAtomsByCodeSab

Atom[] findAtomsByCodeSab(String code,
                          Set sources)
                          throws IOException
Looks up the given code in the CODE_SAB_MRCONSO.x index file and returns the Atom[] of Atoms that have the given code and that are in any of the given Sources.

Parameters:
code - to be searched for
sources - that returned Atoms may belong to
Returns:
Atom[] of Atoms with the given code and in one of the given sources
Throws:
IOException

getPreexpandedRawFiles

String[] getPreexpandedRawFiles()
Returns list of file names that should be preexpanded to show user initial content when concepts are first opened in browser.

Returns:
list of files whose data should be preexpanded


Copyright ©2005