Cytoscape 2.6.2 (c) 2006,2007 ISB, MSKCC, UCSD

cytoscape.visual
Class CalculatorIO

java.lang.Object
  extended by cytoscape.visual.CalculatorIO

public class CalculatorIO
extends Object

This class defines static methods for reading calculator definitions from a properties object and installing them into a CalculatorCatalog, and for constructing a properties object that describes all the calculators in a CalculatorCatalog.


Constructor Summary
CalculatorIO()
           
 
Method Summary
static Properties getProperties(CalculatorCatalog catalog)
          Given a CalculatorCatalog, assembles a Properties object representing all of the calculators contained in the catalog.
static void loadCalculators(Properties props, CalculatorCatalog catalog)
          Equivalent to loadCalculators(props, catalog, true);
static void loadCalculators(Properties props, CalculatorCatalog catalog, boolean overWrite)
          Loads calculators from their description in a Properties object into a supplied CalculatorCatalog object.
static void renameAsNeeded(Calculator c, CalculatorCatalog catalog)
          Given a Calculator of a given type and a CalculatorCatalog, checks for an existing catalog with the same name and type.
static void storeCatalog(CalculatorCatalog catalog, File outFile)
          Writes the contents of a CalculatorCatalog to the specified file as a properties file.
static void storeCatalog(CalculatorCatalog catalog, Writer writer)
          Writes the contents of a CalculatorCatalog to the specified writer as a properties file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CalculatorIO

public CalculatorIO()
Method Detail

storeCatalog

public static void storeCatalog(CalculatorCatalog catalog,
                                File outFile)
                         throws IOException
Writes the contents of a CalculatorCatalog to the specified file as a properties file. This method sorts the lines of text produced by the store method of Properties, so that the properties descriptions of the calculators are reasonably human-readable.

Throws:
IOException

storeCatalog

public static void storeCatalog(CalculatorCatalog catalog,
                                Writer writer)
                         throws IOException
Writes the contents of a CalculatorCatalog to the specified writer as a properties file. This method sorts the lines of text produced by the store method of Properties, so that the properties descriptions of the calculators are reasonably human-readable.

Throws:
IOException

getProperties

public static Properties getProperties(CalculatorCatalog catalog)
Given a CalculatorCatalog, assembles a Properties object representing all of the calculators contained in the catalog. The resulting Properties object, if passed to the loadCalculators method, would reconstruct all the calculators. This method works by getting each set of calculators from the catalog and calling the getProperties method on each calculator with the proper header for the property key.


loadCalculators

public static void loadCalculators(Properties props,
                                   CalculatorCatalog catalog)
Equivalent to loadCalculators(props, catalog, true);


loadCalculators

public static void loadCalculators(Properties props,
                                   CalculatorCatalog catalog,
                                   boolean overWrite)
Loads calculators from their description in a Properties object into a supplied CalculatorCatalog object. This method searches the Properties object for known keys identifying calculators, then delegates to other methods that use the preprocessed properties to construct valid calculator objects. For any calculator defined by the Properties, it is possible for the catalog to already hold a calculator with the same name and interface type (especially if this method has already been run with the same Properties object and catalog). If the overWrite argument is true, this method will remove any such duplicate calculator before adding the new one to prevent duplicate name exceptions. If overwrite is false, this method will get a unique name from the catalog and change the name of the installed calculator as needed.


renameAsNeeded

public static void renameAsNeeded(Calculator c,
                                  CalculatorCatalog catalog)
Given a Calculator of a given type and a CalculatorCatalog, checks for an existing catalog with the same name and type. If one exists, gets a new unique name from the catalog and applied it to the calculator argument.


www.cytoscape.org