org.peace_tools.workspace
Class FWAnalyzer

java.lang.Object
  extended by org.peace_tools.workspace.FWAnalyzer

public class FWAnalyzer
extends java.lang.Object

A simple class to encapsulate information about the frame/word analyzer that was used to generate Minimum Spanning Tree (MST) data. This class provides the necessary helper methods to marhsall and unmarshall the needed data from-and-to XML.


Nested Class Summary
static class FWAnalyzer.FWAnalyzerType
          The different kinds of frame/word analyzers that are currently supported in PEACE.
 
Field Summary
private  int cacheSize
          The size of each cache entry (per EST) in number of distance/similarity metrics that are to be cached to avoid having to recompute metrics.
private  java.lang.String cacheType
          The type of cache that was used to hold the data distance/similarity metric when the analysis was conducted.
private  boolean isDistance
          Flag to indicate if this f/w analyzer provides distance metrics (rather than similarity) for identifying similar ESTs.
private  FWAnalyzer.FWAnalyzerType type
          The type of f/w analyzer that this object contains information about.
private  int windowSize
          The size of the window or the frame size that was used for analyzing EST sequences.
private  int wordSize
          The word size that was used for analyzing EST sequences.
 
Constructor Summary
FWAnalyzer(FWAnalyzer.FWAnalyzerType type, boolean isDistance, int windowSize, int wordSize, java.lang.String cacheType, int cacheSize)
          The constructor merely initializes the immutable instance variables to their values using appropriate parameters.
 
Method Summary
static FWAnalyzer create(org.w3c.dom.Element analyzer)
          Helper method to utilize data from a DOM tree to create a suitable FWAnalyzer entry.
 int getCacheSize()
          The size of each cache entry (per EST) in number of distance/similarity metrics that are to be cached to avoid having to recompute metrics.
 java.lang.String getCacheType()
          The type of cache that was used to cache distance/similarity metrics generated during MST construction.
 int getFrameSize()
          The frame/window size that was used to analyze EST sequences.
 FWAnalyzer.FWAnalyzerType getType()
          Determine the type of f/w analyzer that this object contains information about.
 int getWordSize()
          The word size that was used to analyze EST sequences.
 boolean isDistance()
          Determine if this f/w analyzer uses a distance metric or a similarity metric.
 void marshall(org.w3c.dom.Element mstData)
          Method to marshall the data stored in this object to become part of a DOM tree element passed in.
 void marshall(java.io.PrintWriter out)
          Method to marshall the data stored in this object directly to a XML fragment.
 java.lang.String toCmdLine()
          Return the information in the form of a partial PEACE command line.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

windowSize

private final int windowSize
The size of the window or the frame size that was used for analyzing EST sequences.


wordSize

private final int wordSize
The word size that was used for analyzing EST sequences.


cacheType

private final java.lang.String cacheType
The type of cache that was used to hold the data distance/similarity metric when the analysis was conducted.


cacheSize

private final int cacheSize
The size of each cache entry (per EST) in number of distance/similarity metrics that are to be cached to avoid having to recompute metrics.


type

private final FWAnalyzer.FWAnalyzerType type
The type of f/w analyzer that this object contains information about.


isDistance

private final boolean isDistance
Flag to indicate if this f/w analyzer provides distance metrics (rather than similarity) for identifying similar ESTs.

Constructor Detail

FWAnalyzer

public FWAnalyzer(FWAnalyzer.FWAnalyzerType type,
                  boolean isDistance,
                  int windowSize,
                  int wordSize,
                  java.lang.String cacheType,
                  int cacheSize)
The constructor merely initializes the immutable instance variables to their values using appropriate parameters.

Parameters:
type - The type of f/w analyzer that this object contains information about.
isDistance - If this f/w analyzer provides a distance metric value then this flag must be true. Otherwise it is assumed that this f/w analyzer provides a similarity metric.
windowSize - The frame/window size that was used to analyze EST sequences.
wordSize - The word size that was used to analyze EST sequences. The word size represents subdivisions with a frame/window.
cacheType - The type of cache that was used to cache distance/similarity metrics generated during MST construction.
cacheSize - The size of each cache entry (per EST) in number of distance/similarity metrics that are to be cached to avoid having to recompute metrics.
Method Detail

create

public static FWAnalyzer create(org.w3c.dom.Element analyzer)
                         throws java.lang.Exception
Helper method to utilize data from a DOM tree to create a suitable FWAnalyzer entry. This method is typically used to create a suitable analyzer entry when loading a Work space into the GUI.

Parameters:
analyzer - The DOM element to be used for creating the Job entry and populating with the needed data.
Returns:
The newly created analyzer entry based on the DOM data.
Throws:
java.lang.Exception - This method throws an exception when errors occur during reading and processing elements from the DOM node.

getType

public FWAnalyzer.FWAnalyzerType getType()
Determine the type of f/w analyzer that this object contains information about.

Returns:
The type of f/w analyzer that was set when this object was created (or loaded from an XML configuration file).

isDistance

public boolean isDistance()
Determine if this f/w analyzer uses a distance metric or a similarity metric.

Returns:
This method returns true if the f/w analyzer uses a distance metric.

getFrameSize

public int getFrameSize()
The frame/window size that was used to analyze EST sequences.

Returns:
This method returns the frame or window size that was set when this object was created (or loaded from an XML configuration file).

getWordSize

public int getWordSize()
The word size that was used to analyze EST sequences. The word size represents subdivisions with a frame/window.

Returns:
This method returns the word size that was set when this object was created (or loaded from an XML configuration file).

getCacheType

public java.lang.String getCacheType()
The type of cache that was used to cache distance/similarity metrics generated during MST construction.

Returns:
This method returns the type of cache that was set when this object was created (or loaded from an XML configuration file).

getCacheSize

public int getCacheSize()
The size of each cache entry (per EST) in number of distance/similarity metrics that are to be cached to avoid having to recompute metrics.

Returns:
This method returns the cache size that was set when this object was created (or loaded from an XML configuration file).

marshall

public final void marshall(org.w3c.dom.Element mstData)
Method to marshall the data stored in this object to become part of a DOM tree element passed in. This method assumes that the element passed in corresponds to the parent MSTData node in the DOM tree.

Parameters:
mstData - The DOM element corresponding to the "MSTData" node that contains this entry.

marshall

public final void marshall(java.io.PrintWriter out)
Method to marshall the data stored in this object directly to a XML fragment. The XML fragment is guaranteed to be compatible with the PEACE work space configuration data.

Parameters:
out - The stream to which the XML must be serialized.

toCmdLine

public java.lang.String toCmdLine()
Return the information in the form of a partial PEACE command line. This method can be used to obtain the information associated with this analyzer as a partial PEACE command line.

Returns:
Return the information as a command line parameter.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object