gov.nih.nlm.mms
Class MetamorphoSys

java.lang.Object
  extended bygov.nih.nlm.mms.MetamorphoSys
All Implemented Interfaces:
SourcesToRemoveListener

public class MetamorphoSys
extends Object
implements SourcesToRemoveListener

This class represents the MetamorphoSys application itself. It primarily is responsible for implementing the subsetting functionality. This class can be directly called as an application if you do not want to run MetamorphoSys with a GUI.

Author:
Deborah Shapiro, Brian Carlsen

Constructor Summary
MetamorphoSys()
          Instantiates a MetamorphoSys object, initializes the ApplicationConfiguration and UserConfigurations from the config/mmsys.a.prop and config/mmsys.prop.sav files.
MetamorphoSys(ApplicationConfiguration ac, UserConfiguration uc)
          Instantiates a MetamorphoSys object.
MetamorphoSys(File default_file, File user_file)
          Instantiates a MetamorphoSys object, initializes the ApplicationConfiguration and UserConfigurations.
MetamorphoSys(Properties user, Properties app)
          Instantiates a MetamorphoSys object, initializes the ApplicationConfiguration and UserConfigurations.
 
Method Summary
protected  void fireSourcesToRemoveChanged()
          Fires a SourcesToRemoveEvent to inform all listening filters to respond to the change in the sources to remove list.
 ApplicationConfiguration getApplicationConfiguration()
          Returns the ApplicationConfiguration.
 BufferedWriter getLog()
          Returns the BufferedWriter log.
 UserConfiguration getUserConfiguration()
          Returns the UserConfiguration.
 void initializeConfigurable(Configurable c)
          Configures a filter or input/output stream.
 void initializeConfigurables()
          Loads and configures the filters and input/output streams.
static void main(String[] args)
          Application entry point if no GUI is desired.
 void setApplicationConfiguration(ApplicationConfiguration dc)
          Sets the ApplicationConfiguration.
 void setUserConfiguration(UserConfiguration uc)
          Sets the UserConfiguration.
 void sourcesToRemoveChanged(SourcesToRemoveEvent e)
          This method is called when there is a change to the selections on the sources to exclude tab.
 void subset()
          Subsets the Metathesaurus.
 void subset(Concept concept)
          Subsets the Concept.
 void subset(Source source_md)
          Sets if Source is in current version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetamorphoSys

public MetamorphoSys()
Instantiates a MetamorphoSys object, initializes the ApplicationConfiguration and UserConfigurations from the config/mmsys.a.prop and config/mmsys.prop.sav files. This constructor directly reports errors via SwingToolkit.reportError(java.lang.String) rather than throwing exceptions.


MetamorphoSys

public MetamorphoSys(File default_file,
                     File user_file)
Instantiates a MetamorphoSys object, initializes the ApplicationConfiguration and UserConfigurations. This constructor directly reports errors via SwingToolkit.reportError(java.lang.String) rather than throwing exceptions.

Parameters:
default_file - File
user_file - File

MetamorphoSys

public MetamorphoSys(ApplicationConfiguration ac,
                     UserConfiguration uc)
Instantiates a MetamorphoSys object.

Parameters:
ac - ApplicationConfiguration
uc - UserConfiguration

MetamorphoSys

public MetamorphoSys(Properties user,
                     Properties app)
Instantiates a MetamorphoSys object, initializes the ApplicationConfiguration and UserConfigurations. Used for on-the-fly subsetting, uses Properties objects rather than configuration files. This constructor directly reports errors via SwingToolkit.reportError(java.lang.String) rather than throwing exceptions.

Parameters:
user - Properties
app - Properties
Method Detail

initializeConfigurables

public void initializeConfigurables()
Loads and configures the filters and input/output streams.


initializeConfigurable

public void initializeConfigurable(Configurable c)
Configures a filter or input/output stream.

Parameters:
c - Configurable

subset

public void subset(Concept concept)
Subsets the Concept. Here we remove content based on the various installed filters but we do not try to use the CuiList or try to resolve references. In other words, related content (CUI2, AUI2) is not part of the subsetting criteria.

Parameters:
concept - the Concept to subset

subset

public void subset(Source source_md)
Sets if Source is in current version.

Parameters:
source_md - Source

subset

public void subset()
Subsets the Metathesaurus. This process has four main stages:
  1. Initialize CuiList. This opens a ConceptInputStream and subsets all Concepts, maintaining a CuiList of those to keep, and those to get rid of.
  2. Subset Concepts. We subset the Concepts in two stages because of the Relationship, Coocurrence, and Context data, all of which have cui1 and cui2 values. In this stage of subsetting we actually subset the Concepts, including this binary data and write the results to the subset destination.
  3. Subset indexes. Once the core content is subsetted, we use the CuiList to keep those IndexEntry objects that are still valid, and these are also written to the subset destination.
  4. Final Processes. Complete final processes which include writing MRCUI, MRAUI and ReleaseMetadata.


getUserConfiguration

public UserConfiguration getUserConfiguration()
Returns the UserConfiguration.

Returns:
the UserConfiguration

setUserConfiguration

public void setUserConfiguration(UserConfiguration uc)
Sets the UserConfiguration.

Parameters:
uc - the UserConfiguration.

getApplicationConfiguration

public ApplicationConfiguration getApplicationConfiguration()
Returns the ApplicationConfiguration.

Returns:
the ApplicationConfiguration

setApplicationConfiguration

public void setApplicationConfiguration(ApplicationConfiguration dc)
Sets the ApplicationConfiguration.

Parameters:
dc - the ApplicationConfiguration.

getLog

public BufferedWriter getLog()
Returns the BufferedWriter log.

Returns:
the BufferedWriter log.

sourcesToRemoveChanged

public void sourcesToRemoveChanged(SourcesToRemoveEvent e)
This method is called when there is a change to the selections on the sources to exclude tab.

Specified by:
sourcesToRemoveChanged in interface SourcesToRemoveListener
Parameters:
e - SourcesToRemoveEvent

fireSourcesToRemoveChanged

protected void fireSourcesToRemoveChanged()
Fires a SourcesToRemoveEvent to inform all listening filters to respond to the change in the sources to remove list.


main

public static void main(String[] args)
Application entry point if no GUI is desired. Running this main method will subset using the MMSYS/config/mmsys.prop.sav configuration file without prompting the user with additional configuration options.

Parameters:
args - String[]


Copyright ©2005