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

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

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

A class that contains file information.

This includes the file name, global and local discriptions that pertain to that file. Note that this is attached to a OperationInfo which dictates what is "local" to this FileInfo.

Author:
Kathe Todd-Brown
See Also:
Serialized Form

Field Summary
private  java.lang.String filename
          A string that holds the absolute file name.
private  java.lang.String globalDisc
          A string that holds the global discrition of this file.
private  java.lang.String localDisc
          A string that holds an operation specific discription of this file.
 
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, 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, TIMESTAMP_KEY, UPDATE_INTERVAL_KEY, USER_EDITOR_KEY, USER_KEY, VS_KEY
 
Constructor Summary
FileInfo()
          Create an empty FileInfo where the file name, local and global discription all set to "".
FileInfo(java.lang.String name, java.lang.String local, java.lang.String global)
          Construct a FileInfo from direct strings.
 
Method Summary
 org.w3c.dom.Element asElement(org.w3c.dom.Document d)
          Convert the information in the FileInfo to an Element.
static java.lang.String fileName(java.lang.String file)
          fileName takes a full file name seperated by either \ or / and return the name and extention of that full name
 java.lang.String getDiscription()
          Get the full discription with both the global and local discription.
 java.lang.String getGlobalDisc()
          Get the global discription for the file.
 java.lang.String getLocalDisc()
          Get the local discription for the file.
static void main(java.lang.String[] args)
           
static java.lang.String quote(java.lang.String given)
           
 void setGlobalDisc(java.lang.String newDisc)
          Set the global discription for this file.
 void setLocalDisc(java.lang.String newDisc)
          Set the local discription for this file.
 java.lang.String toString()
          Show the file name as the string representation of this class.
 
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

filename

private java.lang.String filename
A string that holds the absolute file name.


globalDisc

private java.lang.String globalDisc
A string that holds the global discrition of this file.


localDisc

private java.lang.String localDisc
A string that holds an operation specific discription of this file.

Constructor Detail

FileInfo

public FileInfo(java.lang.String name,
                java.lang.String local,
                java.lang.String global)
Construct a FileInfo from direct strings.

Parameters:
name - a string holding the absolute file name
global - a string of the global discription
local - a string of the local operation specific discription

FileInfo

public FileInfo()
Create an empty FileInfo where the file name, local and global discription all set to "".

Method Detail

setLocalDisc

public void setLocalDisc(java.lang.String newDisc)
Set the local discription for this file.

Parameters:
newDisc - A String with the new discription.

getLocalDisc

public java.lang.String getLocalDisc()
Get the local discription for the file.

Returns:
A String containing the local file discription.

setGlobalDisc

public void setGlobalDisc(java.lang.String newDisc)
Set the global discription for this file.

Parameters:
newDisc - A string with the new discription.

getGlobalDisc

public java.lang.String getGlobalDisc()
Get the global discription for the file.

Returns:
A String containing the global file discription.

fileName

public static java.lang.String fileName(java.lang.String file)
fileName takes a full file name seperated by either \ or / and return the name and extention of that full name

Parameters:
file - a full file name
Returns:
the file name striped of the directory info

quote

public static java.lang.String quote(java.lang.String given)

getDiscription

public java.lang.String getDiscription()
Get the full discription with both the global and local discription.

Returns:
A String that has the global and local file discription seperated by a ";".

asElement

public org.w3c.dom.Element asElement(org.w3c.dom.Document d)
Convert the information in the FileInfo to an Element.

Parameters:
d - A Document to generate the element from.
Returns:
An Element that represents the information in the FileInfo

toString

public java.lang.String toString()
Show the file name as the string representation of this class.

Overrides:
toString in class javax.swing.tree.DefaultMutableTreeNode
Returns:
A String that is the file name. Note there is no discription in this.

main

public static void main(java.lang.String[] args)