org.peace_tools.workspace
Class MSTClusterData

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

public class MSTClusterData
extends java.lang.Object

This class encapsulates all the data necessary to use a given clustering information generated from a Spanning Tree (MST) data file. This element contains meta data about the MST file. The MSTClusterData class is created each time a new Job is run to cluster based on a given MST data set. The MST data is the primary input from which the cluster data is derived.

In addition to encapsulating the data this class also provides convenient interfaces for marshalling and unmarshalling XML data compatible with the PEACE GUI configuration XML file format.


Field Summary
private  DataSet dataSet
          Reference to the data set that logically contains this MSTData element.
private  java.lang.String description
          A user defined description for this file.
private  java.lang.String id
          The unique generated ID value for this entry.
private  JobSummary jobSummary
          The core/useful information about the job that was run to compute the MST.
protected  java.lang.String mstID
          The unique value for the MSTData entry based on which this cluster data was generated.
private  java.lang.String path
          The path to the actual MST file (on the local machine) that is referred by this entry.
private  int threshold
          The threshold value used for cluster generating.
 
Constructor Summary
MSTClusterData(java.lang.String id, java.lang.String mstID, java.lang.String path, java.lang.String description, int threshold, JobSummary summary)
          The constructor to create a fully populated MSTClusterData object that contains all the meta data regarding a MST file that has been generated from a given EST file.
 
Method Summary
static MSTClusterData create(org.w3c.dom.Element clstrData)
          Helper method to utilize data from a DOM tree to create a suitable MSTClusterData entry.
 DataSet getDataSet()
          Obtain the data set that logically contains this MST Data.
 java.lang.String getDescription()
          Obtain the user supplied description for this this data.
 java.lang.String getID()
          Obtain the work space wide unique identifier set for this entry.
 JobSummary getJobSummary()
          Obtain meta data about the job that was run to generate the cluster.
 java.lang.String getMSTID()
          Obtain the work space wide unique identifier set for this MST data set.
 java.lang.String getPath()
          Obtain the complete file name and path where the actual cluster file is located.
 java.lang.String getSummary(java.lang.String indent)
          Provides a textual multi-line summary for this element.
 int getThreshold()
          The threshold value used for cluster generating.
 void marshall(org.w3c.dom.Element dataset)
          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.
protected  void setDataSet(DataSet dataSet)
          Set the data set that this object logically belongs to.
 java.lang.String toCmdLine()
          Return the information in the form of a partial PEACE command line parameter.
 java.lang.String toString()
          Overrides the default implementation in the base class to simply return the last part of the cluster file associated with this entry.
 void updateJobSummary(Job job)
          Set revised updated information about the job associated with this MSTData entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dataSet

private transient DataSet dataSet
Reference to the data set that logically contains this MSTData element. This element is not serialized to XML format (and consequently is flagged transient).


id

private java.lang.String id
The unique generated ID value for this entry. This value is created when a new entry is added. This value is persisted in the work space configuration. It provides a convenient mechanism to refer to a specific entry within the workspace. The IDs are generated via a call to Workspace.reserveID() method.


mstID

protected final java.lang.String mstID
The unique value for the MSTData entry based on which this cluster data was generated. This value value is persisted in the work space configuration.


path

private final java.lang.String path
The path to the actual MST file (on the local machine) that is referred by this entry.


description

private final java.lang.String description
A user defined description for this file. This description is set when a new job is scheduled and persisted in the work space configuration for future references.


threshold

private final int threshold
The threshold value used for cluster generating. The threshold defines the metric on a given edge of a MST that identifies transition to a new cluster.


jobSummary

private JobSummary jobSummary
The core/useful information about the job that was run to compute the MST.

Constructor Detail

MSTClusterData

public MSTClusterData(java.lang.String id,
                      java.lang.String mstID,
                      java.lang.String path,
                      java.lang.String description,
                      int threshold,
                      JobSummary summary)
The constructor to create a fully populated MSTClusterData object that contains all the meta data regarding a MST file that has been generated from a given EST file.

Parameters:
id - The workspace wide unique ID associated with this entry.
mstID - The unique MST data set ID value for this data.
path - The path to the actual cluster file (on the local machine) that is referred by this entry.
description - A user defined description for this file.
threshold - The threshold value used to partition a MST.
summary - The core/useful information about the job that was run to compute the MST.
Method Detail

create

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

Parameters:
clstrData - The DOM element to be used for creating the cluster entry and populating with the needed data.
Returns:
The newly created data 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.

getID

public java.lang.String getID()
Obtain the work space wide unique identifier set for this entry. The ID value is created when a job is scheduled to compute clustering from a data set. The ID is persisted in the work space configuration file and loaded when a work space is opened in the GUI.

Returns:
This method returns the unique identifier set for this data set.

getMSTID

public java.lang.String getMSTID()
Obtain the work space wide unique identifier set for this MST data set. The ID value is created when new jobs are scheduled to create cluster data. These IDs are persisted in the work space configuration file and loaded when a work space is opened in the GUI.

Returns:
This method returns the unique MSTData identifier set for this data set.

getPath

public java.lang.String getPath()
Obtain the complete file name and path where the actual cluster file is located. This value is set when a new job to generate this cluster data is scheduled. The path for the file is persisted in the work space configuration file and loaded when a work space is opened in the GUI.

Returns:
This method returns the path to the cluster file.

getDescription

public java.lang.String getDescription()
Obtain the user supplied description for this this data. The value is set when new jobs are scheduled. The description is persisted in the work space configuration file and loaded when a work space is opened in the GUI.

Returns:
This method returns the user supplied description set for this job.

getJobSummary

public JobSummary getJobSummary()
Obtain meta data about the job that was run to generate the cluster. The JobID in the job summary can be used to look up additional information about the job. Similarly, the serverID value in the job summary can be used to look up information about the server on which the job was run.

Returns:
This method returns information about the job that was run to generate the cluster data.

getThreshold

public int getThreshold()
The threshold value used for cluster generating. The threshold defines the metric on a given edge of a MST that identifies transition to a new cluster.

Returns:
The threshold value that was used to generate the clusters.

marshall

public final void marshall(org.w3c.dom.Element dataset)
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 DataSet node in the DOM tree.

Parameters:
dataset - The DOM element corresponding to the "DataSet" 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.

toString

public java.lang.String toString()
Overrides the default implementation in the base class to simply return the last part of the cluster file associated with this entry.

Overrides:
toString in class java.lang.Object
Returns:
A short string representation that is easy to display primarily in a tree view of the work space.

toCmdLine

public java.lang.String toCmdLine()
Return the information in the form of a partial PEACE command line parameter. This method can be used to obtain the information needed to generate the MST based on the supplied information in the form of a command line parameter.

Returns:
Return the information as a command line parameter.

updateJobSummary

public void updateJobSummary(Job job)
Set revised updated information about the job associated with this MSTData entry.

Parameters:
job - The job from where the necessary information is to be copied.

setDataSet

protected void setDataSet(DataSet dataSet)
Set the data set that this object logically belongs to.

Note: This method is used by the DataSet. Use DataSet.add(MSTClusterData) method to add a MSTClusterData object to a data set.

Parameters:
dataSet - The data set to which this object has been added.

getDataSet

public DataSet getDataSet()
Obtain the data set that logically contains this MST Data.

Returns:
The data set that logically contains this object. This value is set only after this object has been added to a data set.

getSummary

public java.lang.String getSummary(java.lang.String indent)
Provides a textual multi-line summary for this element. This method is typically used by GUI to display a simple representation of the data stored in this element.

Parameters:
indent - The leading spaces to be used for indenting each line. This parameter cannot be null.
Returns:
A textual multi-line summary of the data in this element.