edu.harvard.mgh.purcell.gCLINE.data
Class OperationInfo

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by edu.harvard.mgh.purcell.gCLINE.data.OperationInfo
All Implemented Interfaces:
KeyWords, java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class OperationInfo
extends javax.swing.tree.DefaultMutableTreeNode
implements KeyWords

A class that contains the information for a given operation.

This includes 1) a unique name 2) assocated command line 3) a discription 4) input files 5) output files.

Author:
Kathe Todd-Brown
See Also:
Serialized Form

Field Summary
private  java.lang.String cline
          A String that holds the command line for this operation.
static java.text.DateFormat DATEFORMAT
           
private  java.lang.String discription
          A String that discribes the operation.
private  javax.swing.tree.DefaultMutableTreeNode input
          A DefaultMutableTreeName that holds the input files.
private  java.lang.String name
          A String that uniquely identifies the operation.
private  javax.swing.tree.DefaultMutableTreeNode output
          A DefaultMutableTreeNode that holds the output files.
private  java.lang.String timestamp
           
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Fields inherited from interface edu.harvard.mgh.purcell.gCLINE.data.KeyWords
BROWSE_KEY, CLINE_KEY, COMMAND_KEY, COMMAND_PREFIX_KEY, FILE_KEY, FOLDER_KEY, GLOBAL_CONFIG, HOME_KEY, HOST_KEY, INFILE_KEY, LOCAL_DIR, LOCAL_FOLDER_KEY, LOCAL_UPDATE_INTERVAL_KEY, LOCK_FILE, META_FILE, NAME_KEY, OP_KEY, OUTFILE_KEY, P1_KEY, P2_KEY, P3_KEY, P4_KEY, PORT_KEY, REMOTE_CONFIG_FILE, REMOTE_FOLDER_KEY, REMOTE_GLOBAL_CONFIG, REMOTE_UPDATE_INTERVAL_KEY, TIMESTAMP_KEY, USER_EDITOR_KEY, USER_KEY, VS_KEY
 
Constructor Summary
OperationInfo()
           
OperationInfo(java.lang.String givenName, java.lang.String givenDisc, java.lang.String command, java.lang.String time)
           
 
Method Summary
 void addFile(java.lang.String type, java.lang.String given_name, java.lang.String localDisc, java.lang.String globalDisc)
          Add a file to one of the file nodes.
private  void addFileToFolder(javax.swing.tree.DefaultMutableTreeNode folder, FileInfo givenFile)
          Add a file to a given folder.
 org.w3c.dom.Element asElement(org.w3c.dom.Document d)
           
 java.lang.String getCline()
           
 java.lang.String getDisc()
           
 java.util.Vector<FileInfo> getInputFiles()
           
 java.io.File getLog(java.io.File localFolder, java.lang.String suffix)
          Get the log file associated with this operation
(package private) static java.io.File getLog(java.io.File localFolder, java.lang.String suffix, java.util.Vector<java.lang.String[]> outfiles)
           
 java.lang.String getName()
          Get the unique name of the operation.
 java.util.Vector<java.lang.String> getOpDetails()
          Get the details of the operation like the command line.
 java.util.Vector<FileInfo> getOutputFiles()
           
 java.lang.String getTimeStamp()
           
 java.lang.String printfull()
          Print out the operation to a string.
 void remoteFile(java.lang.String filename)
           
 java.lang.String toString()
          Get the name and discription of this operation.
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private java.lang.String name
A String that uniquely identifies the operation.


discription

private java.lang.String discription
A String that discribes the operation.


cline

private java.lang.String cline
A String that holds the command line for this operation.


input

private javax.swing.tree.DefaultMutableTreeNode input
A DefaultMutableTreeName that holds the input files.


output

private javax.swing.tree.DefaultMutableTreeNode output
A DefaultMutableTreeNode that holds the output files.


timestamp

private java.lang.String timestamp

DATEFORMAT

public static java.text.DateFormat DATEFORMAT
Constructor Detail

OperationInfo

public OperationInfo()

OperationInfo

public OperationInfo(java.lang.String givenName,
                     java.lang.String givenDisc,
                     java.lang.String command,
                     java.lang.String time)
Method Detail

getName

public java.lang.String getName()
Get the unique name of the operation.

Returns:
A String that is the operation's name.

getDisc

public java.lang.String getDisc()

getCline

public java.lang.String getCline()

getInputFiles

public java.util.Vector<FileInfo> getInputFiles()

getOutputFiles

public java.util.Vector<FileInfo> getOutputFiles()

getLog

public java.io.File getLog(java.io.File localFolder,
                           java.lang.String suffix)
Get the log file associated with this operation

Parameters:
localFolder - A file reflecting the local reference for this project
suffix - A String that is the log suffix (example: .log)
Returns:
A File that is the local log file, null if none found

getLog

static java.io.File getLog(java.io.File localFolder,
                           java.lang.String suffix,
                           java.util.Vector<java.lang.String[]> outfiles)

getTimeStamp

public java.lang.String getTimeStamp()

remoteFile

public void remoteFile(java.lang.String filename)

addFile

public void addFile(java.lang.String type,
                    java.lang.String given_name,
                    java.lang.String localDisc,
                    java.lang.String globalDisc)
Add a file to one of the file nodes.

Parameters:
type - A String flag from KeyWords that flags this file as either an input or an output.
given_name - A String that holds the file name.
localDisc - A String that is the discription for this file local to this operation.
globalDisc - A String that is the discription for this file globally.

addFileToFolder

private void addFileToFolder(javax.swing.tree.DefaultMutableTreeNode folder,
                             FileInfo givenFile)
Add a file to a given folder.

Parameters:
folder - A DefaultMutableTreeNode that represents either then input or output folder for this operation.
givenFile - A FileInfo that is the file we wish to add to the given folder.

toString

public java.lang.String toString()
Get the name and discription of this operation.

Overrides:
toString in class javax.swing.tree.DefaultMutableTreeNode
Returns:
A String that is the name and discription of this operation seperated by ":".

getOpDetails

public java.util.Vector<java.lang.String> getOpDetails()
Get the details of the operation like the command line.

Returns:
a vector contianing the deals of the operation

printfull

public java.lang.String printfull()
Print out the operation to a string.

Returns:
The entire operation as a flat string.

asElement

public org.w3c.dom.Element asElement(org.w3c.dom.Document d)