edu.pdx.cs399J.grader
Class Report

java.lang.Object
  extended by edu.pdx.cs399J.grader.Report

public class Report
extends Object

This class represents a report that is generated as a result of running a student's program.

Author:
David Whitlock

Constructor Summary
Report(PrintWriter pw)
          Creates a new Report that sends its output to a given PrintWriter.
Report(String id, File logDir)
          Creates a new Report for a given student.
 
Method Summary
 void finalize()
          Make sure we're done when this Report gets garbage collected.
 void flush()
          Flushes the stream that is being written to
 void logException(String msg, Exception ex)
          Makes note of an exception
 void printBanner(String text, char c)
          Prints a line of text to the log file, centers it, around surrounds it with a given character.
 void println(Object o)
          Prints a left justified line of text to the log file.
 void println(String text)
          Prints a left justified line of text to the log file.
 void printlnCentered(String text)
          Prints a line of text to the log file and centers it.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Report

public Report(PrintWriter pw)
Creates a new Report that sends its output to a given PrintWriter. This is useful when you want to dump to the console. The "student's" id is "writer".


Report

public Report(String id,
              File logDir)
Creates a new Report for a given student. It will create a log file in given directory.

Parameters:
id - The student's login id
logDir - Directory into which the log file is placed.
Method Detail

logException

public void logException(String msg,
                         Exception ex)
Makes note of an exception


flush

public void flush()
Flushes the stream that is being written to


println

public void println(Object o)
Prints a left justified line of text to the log file.


println

public void println(String text)
Prints a left justified line of text to the log file.


printlnCentered

public void printlnCentered(String text)
Prints a line of text to the log file and centers it.


printBanner

public void printBanner(String text,
                        char c)
Prints a line of text to the log file, centers it, around surrounds it with a given character.


finalize

public void finalize()
Make sure we're done when this Report gets garbage collected. This way, the stream will always get closed.

Overrides:
finalize in class Object


Copyright © 2000-2009 Portland State University. All Rights Reserved.