|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nih.nlm.mms.browser.RRFBrowsableInputStream
public class RRFBrowsableInputStream
Rich Release Format implementation of BrowsableInputStream. For this
class to be usable the directory must be set with
setDirectory(String).
| Constructor Summary | |
|---|---|
RRFBrowsableInputStream()
Constructor. |
|
| Method Summary | |
|---|---|
void |
buildIndexes(ProgressMonitor pm)
Builds the indexes in the RRFBrowsableInputStream. |
boolean |
buildIndexesNeeded()
Indicates if indexes in the RRFBrowsableInputStream need to be
built. |
void |
close()
Closes the RRFBrowsableInputStream. |
boolean |
containsConcept(String cui)
Indicates if the RRFBrowsableInputStream
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 RRFBrowsableInputStream contains RRF data. |
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 RRFBrowsableInputStream. |
String |
getName()
Returns the name of the Input Format. |
String |
getNullValue()
Returns the null value. |
List |
getPrecedenceOrder()
Gets the list of source TTYs in precedence order. |
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 RRF 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 provide historical information for the
specified CUI. |
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 the List of included 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 from MRDOC.RRF and MRSAB.RRF files. |
protected boolean |
initializeMetadataNeeded()
Indicates if metadata classes need to be initialized. |
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. |
void |
open()
Opens the RRFBrowsableInputStream. |
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
MRSAB.RRF, MRCUI.RRF, MRAUI.RRF,
and MRDOC.RRF. |
void |
setDirectory(String newDirectory)
Sets directory of RRFBrowsableInputStream. |
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 |
| Constructor Detail |
|---|
public RRFBrowsableInputStream()
| Method Detail |
|---|
public void setNullValue(String null_value)
setNullValue in interface LocalNullValueSupportnull_value - the new null string valuepublic String getNullValue()
getNullValue in interface LocalNullValueSupportpublic boolean isEmptyValue(String token)
isEmptyValue in interface LocalNullValueSupportpublic String getDirectory()
RRFBrowsableInputStream.
getDirectory in interface BrowsableInputStreamRRFBrowsableInputStream.public void setDirectory(String newDirectory)
RRFBrowsableInputStream.
setDirectory in interface BrowsableInputStreamnewDirectory - directory of RRFBrowsableInputStreampublic boolean directoryContainsExpectedData()
RRFBrowsableInputStream contains RRF data.
directoryContainsExpectedData in interface BrowsableInputStreamtrue if the directory set by
setDirectory(String) contains RRF data, otherwise
false.
public void open()
throws IOException
RRFBrowsableInputStream.
open in interface BrowsableInputStreamIOException - if there is a problem opening the
RRFBrowsableInputStream.
public void close()
throws IOException
RRFBrowsableInputStream.
close in interface BrowsableInputStreamIOException - if there is a problem closing the
RRFBrowsableInputStream.protected boolean initializeMetadataNeeded()
true if the metadata classes need to be initialized;
false otherwise.initializeMetadata()
public void initializeMetadata()
throws IOException
AttributeNameCoocurrenceTypeLanguageAdditionalRelationshipLabelRelationshipLabelSourceIdentifierTypeStringTypeSuppressibleTermStatusTermTypeTermTypeGroup
initializeMetadata in interface BrowsableInputStreamIOException
public ReleaseMetadata readReleaseMetadata()
throws IOException
ReleaseMetadata containing data from
MRSAB.RRF, MRCUI.RRF, MRAUI.RRF,
and MRDOC.RRF.
readReleaseMetadata in interface BrowsableInputStreamReleaseMetadata
IOException - if the files could not be read.public boolean buildIndexesNeeded()
RRFBrowsableInputStream need to be
built.
buildIndexesNeeded in interface BrowsableInputStreamtrue if indexes needed to be built; false
otherwise.
public void buildIndexes(ProgressMonitor pm)
throws IOException
RRFBrowsableInputStream.
buildIndexes in interface BrowsableInputStreampm - ProgressMonitor for displaying progress of
the operation
IOExceptionpublic List getPrecedenceOrder()
getPrecedenceOrder in interface BrowsableInputStreamList of source TTYs in precedence order.public List getSourceList()
List of included sources.
getSourceList in interface BrowsableInputStreamList.public String getName()
getName in interface BrowsableInputStreampublic Color getColor()
getColor in interface BrowsableInputStreampublic String getReleaseVersion()
getReleaseVersion in interface BrowsableInputStream
public Concept readConcept(String cui,
ConceptDataSelector selector)
throws IOException
Concept with the amount of
information specified by a ConceptDataSelector.
readConcept in interface BrowsableInputStreamcui - CUI (concept unique identifier) of the Concept desiredselector - ConceptDataSelector
Concept according to the specified
ConceptDataSelector.
IOException
public Atom readAtom(String aui,
AtomDataSelector selector)
throws IOException
Atom that
contains the given AUI.
readAtom in interface BrowsableInputStreamaui - AUI to be searched forselector - AtomDataSelector specifying how to populate the
Atom
Atom containing the AUI, populated according to the
AtomDataSelector.
IOException
public Map getRawConceptWithLinks(String cui,
LinkGenerator link_gen)
throws IOException
Map that has concept data RRF filename
String objects as keys and have String[] values
which are the lines in the file matching the specified CUI.
getRawConceptWithLinks in interface BrowsableInputStreamcui - UMLS CUIlink_gen - LinkGenerator used to
insert hyperlinks to referenced CUIs and AUIs
Map from each RRF file name to an array of the lines in
that file matching the specified CUI.
IOException
public Map getRawHistoryData(String cui)
throws IOException
Map that has history filename
String objects as keys and have String[] values
which are the lines of the file that provide historical information for the
specified CUI.
getRawHistoryData in interface BrowsableInputStreamcui - UMLS CUI
Map that has history filename
String objects as keys and have String[] values
which are the lines of the file that provide historical information for
the specified CUI
IOException
public Map getRawMetadata()
throws IOException
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.
getRawMetadata in interface BrowsableInputStreamMap 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.
IOException
public boolean containsConcept(String cui)
throws IOException
RRFBrowsableInputStream
contains the concept specified by the CUI.
containsConcept in interface BrowsableInputStreamcui - CUI of the concept in question
true if the data set contains the concept specified by
the CUI.
IOException
public int countSiblings(Context context)
throws IOException
BrowsableInputStreamContext.
countSiblings in interface BrowsableInputStreamIOException
public boolean hasSiblings(Context context)
throws IOException
BrowsableInputStreamContext has siblings.
hasSiblings in interface BrowsableInputStreamtrue if context has siblings
false otherwise
IOException
public Context[] findSiblings(Context context,
SearchOptions options)
throws IOException
BrowsableInputStreamContext[] of siblings for the given context.
findSiblings in interface BrowsableInputStreamoptions - SearchOptions specify parameters
IOException
public int countChildren(Context context)
throws IOException
BrowsableInputStreamContext.
countChildren in interface BrowsableInputStreamIOException
public boolean hasChildren(Context context)
throws IOException
BrowsableInputStreamContext has children.
hasChildren in interface BrowsableInputStreamtrue if context has children
false otherwise
IOException
public Context[] findChildren(Context context,
SearchOptions options)
throws IOException
BrowsableInputStreamContext[] of children for the given context.
findChildren in interface BrowsableInputStreamoptions - SearchOptions specify parameters
IOException
public Set findWordMatches(String word,
Language language)
throws IOException,
InterruptedException
WordSearchResults of Concepts with Strings
containing the specified word.
findWordMatches in interface BrowsableInputStreamword - search word or partial search word with wild card '*' at endlanguage - Language of strings to be found
Set of WordSearchResults consisting of matches on
the specified word.
IOException
InterruptedException
public int getWordFrequency(String word,
Language language)
throws IOException
getWordFrequency in interface BrowsableInputStreamword - word or partial word followed by a wild card character '*'.language - Language of strings to search
IOException
public Atom[] findAtomsByCodeSab(String code,
Set sources)
throws IOException
Atom[] of Atoms that have the given code and that are in
any of the given Sources.
findAtomsByCodeSab in interface BrowsableInputStreamcode - to be searched forsources - Set of sources that returned Atoms may belong to
Atom[] of Atoms with the given code and in one of the given sources
IOExceptionpublic String[] getPreexpandedRawFiles()
getPreexpandedRawFiles in interface BrowsableInputStream
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||