sofya.viewers
Class MapViewer

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

public class MapViewer
extends Viewer

The MapViewer is used to display the contents of a map (.map) file in human-readable form.

Usage:
java sofya.viewers.MapViewer [-tag tag] <SourceFile.java> [OutputFile]
     -tag tag : Specify tag associated with the subject's database files
     [OutputFile] : Redirect output of viewer to OutputFile
     (SourceFile must include .java extension. Do not include any path.)

Version:
09/23/2004
Author:
Alex Kinneer

Field Summary
 
Fields inherited from class sofya.viewers.Viewer
destStream, inputFile, LINE_SEP, outputFile, stdin
 
Constructor Summary
MapViewer(java.lang.String inputFile)
          Standard constructor, creates a MapViewer to display the formatted contents of the specified map file to the system console (System.out).
MapViewer(java.lang.String inputFile, java.io.OutputStream stream)
          Standard constructor, creates a MapViewer to display the formatted contents of the specified map file to the specified output stream.
MapViewer(java.lang.String inputFile, java.lang.String outputFile)
          Standard constructor, creates a MapViewer to display the formatted contents of the specified map file to the specified output file.
 
Method Summary
static void main(java.lang.String[] argv)
          Entry point for MapViewer.
 void print(java.io.PrintWriter stream)
          Prints the map information to the specified stream.
 void setTag(java.lang.String tag)
          Specifies a tag to be associated with the file to be viewed.
 
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
 

Constructor Detail

MapViewer

public MapViewer(java.lang.String inputFile)
Standard constructor, creates a MapViewer to display the formatted contents of the specified map file to the system console (System.out).

Parameters:
inputFile - Name of the map file to be displayed, with .java extension.

MapViewer

public MapViewer(java.lang.String inputFile,
                 java.lang.String outputFile)
          throws SameFileNameException,
                 java.io.IOException
Standard constructor, creates a MapViewer to display the formatted contents of the specified map file to the specified output file.

Parameters:
inputFile - Name of the map file to be displayed, with .java extension.
outputFile - Name of the file to which the viewer output should be written.
Throws:
SameFileNameException - If the specified output file and input file are the same file.
java.io.IOException - If there is an error creating the output file.

MapViewer

public MapViewer(java.lang.String inputFile,
                 java.io.OutputStream stream)
Standard constructor, creates a MapViewer to display the formatted contents of the specified map file to the specified output stream.

Note: When using Viewer.print(), an output file specified using Viewer.setOutputFile(java.lang.String) takes precedence over the specified stream.

Parameters:
inputFile - Name of the map file to be displayed, with .java extension.
stream - Stream to which the viewer output should be written.
Method Detail

print

public void print(java.io.PrintWriter stream)
           throws java.io.IOException
Prints the map information to the specified stream.

Specified by:
print in class Viewer
Parameters:
stream - Stream to which the map information should be written.
Throws:
java.io.IOException - If there is an error writing to the stream, or creating the output file, if applicable.

setTag

public void setTag(java.lang.String tag)
Specifies a tag to be associated with the file to be viewed.

The given tag name actually gets mapped to a subdirectory in the database internally.

Parameters:
tag - Tag which is associated with the file being viewed.

main

public static void main(java.lang.String[] argv)
Entry point for MapViewer.