sofya.viewers
Class MutationTableViewer

java.lang.Object
  extended by sofya.viewers.Viewer
      extended by sofya.viewers.MutationTableViewer

public class MutationTableViewer
extends Viewer

The MutationTableViewer is used to display the a mutation table in a human readable format, or as a list for processing.

Usage:
java sofya.viewers.MutationTableViewer <mutation_table_file> [-t l|d] [OutputFile]
     -t l|d : Format of the output. l indicates machine readable, d indicates human readable.
     OutputFile : Redirect output of viewer to OutputFile

Version:
05/23/2006
Author:
Alex Kinneer

Field Summary
static int DESCRIPTIVE
          Constant flag for descriptive format.
static int LIST
          Constant flag for list format.
 
Fields inherited from class sofya.viewers.Viewer
destStream, inputFile, LINE_SEP, outputFile, stdin
 
Constructor Summary
MutationTableViewer(java.lang.String inputFile, int format)
          Creates a MutationTableViewer to display a mutation table.
MutationTableViewer(java.lang.String inputFile, java.io.OutputStream stream, int format)
          Creates a MutationTableViewer to display a mutation table in the specified format to the specified output stream.
MutationTableViewer(java.lang.String inputFile, java.lang.String outputFile, int format)
          Creates a MutationTableViewer to display a mutation table in the specified format to the specified output file.
 
Method Summary
 int getOutputFormat()
          Gets the output format currently set to be used.
static void main(java.lang.String[] argv)
           
 void print(java.io.PrintWriter pw)
          Prints the viewer output to the specified stream - subclasses must provide the implementation for this method.
 void setOutputFormat(int format)
          Sets the output format to be used.
 
Methods inherited from class sofya.viewers.Viewer
print, printMethodName, rightJust, setInputFile, setOutputFile, setOutputStream, sizeString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIST

public static final int LIST
Constant flag for list format.

See Also:
Constant Field Values

DESCRIPTIVE

public static final int DESCRIPTIVE
Constant flag for descriptive format.

See Also:
Constant Field Values
Constructor Detail

MutationTableViewer

public MutationTableViewer(java.lang.String inputFile,
                           int format)
Creates a MutationTableViewer to display a mutation table.

Parameters:
inputFile - Name of the mutation table file to be displayed.
format - Output format to be used. Should be one of the following:
  • MutationTableViewer.LIST
  • MutationTableViewer.DESCRIPTIVE

MutationTableViewer

public MutationTableViewer(java.lang.String inputFile,
                           java.lang.String outputFile,
                           int format)
                    throws SameFileNameException,
                           java.io.IOException
Creates a MutationTableViewer to display a mutation table in the specified format to the specified output file.

Parameters:
inputFile - Name of the mutation table file to be displayed.
outputFile - Name of the file to which the viewer output should be written.
format - Output format to be used. Should be one of the following:
  • MutationTableViewer.LIST
  • MutationTableViewer.DESCRIPTIVE
Throws:
SameFileNameException
java.io.IOException

MutationTableViewer

public MutationTableViewer(java.lang.String inputFile,
                           java.io.OutputStream stream,
                           int format)
Creates a MutationTableViewer to display a mutation table in the specified format to the specified output stream.

Parameters:
inputFile - Name of the mutation table file to be displayed.
stream - Stream to which the viewer output should be written.
format - Output format to be used. Should be one of the following:
  • MutationTableViewer.LIST
  • MutationTableViewer.DESCRIPTIVE
Method Detail

setOutputFormat

public void setOutputFormat(int format)
Sets the output format to be used.

Parameters:
format - Output format to be used. Should be one of the following:
  • MutationTableViewer.LIST
  • MutationTableViewer.DESCRIPTIVE
Throws:
java.lang.IllegalArgumentException - If the specified output format is not recognized.

getOutputFormat

public int getOutputFormat()
Gets the output format currently set to be used.

Returns:
An integer representing the currently specified output format (see setOutputFormat(int)).

print

public void print(java.io.PrintWriter pw)
           throws java.io.IOException
Description copied from class: Viewer
Prints the viewer output to the specified stream - subclasses must provide the implementation for this method.

The stream passed to this method takes highest precedence, it need not necessarily be any stream maintained or created internally by the viewer. Use Viewer.print() to have the viewer select or create a stream based on specified settings and an order of precedence.

Specified by:
print in class Viewer
Parameters:
pw - Stream to which the viewer outputs are to be written.
Throws:
java.io.IOException - If there is an error writing to the stream.

main

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