QSopt 0.5 Alpha
All Rights Reserved

qs
Class Reporter

java.lang.Object
  extended byqs.Reporter

public class Reporter
extends java.lang.Object

Reporter essentially wraps a PrintStream. It provides a few printing utilities. A Reporter can optionally prefix printed text with timer information.


Field Summary
static int TRACE
           
 
Constructor Summary
Reporter()
          construct with System.out stream and notime == true
Reporter(java.io.PrintStream p)
          construct with PrintStream p and notime == true
Reporter(java.io.PrintStream p, boolean notime)
          construct with PrintStream p and notime
 
Method Summary
 void adjustTimer(long delta)
          UNDOCUMNETED
 void flush()
          flush the Reporter's stream
 void interrupt()
           
 void print_array(java.lang.String name, double[] a)
          print lines "name[i] = a[i]" for each element of a to Reporter's stream
 void print_array(java.lang.String name, int[] a)
          print lines "name[i] = a[i]" for each element of a to Reporter's stream
 void print_array(java.lang.String name, java.lang.Object[] a)
          print lines "name[i] = a[i]" for each element of a to Reporter's stream
 void print_array(java.lang.String name, java.lang.String[] a)
          print lines "name[i] = a[i]" for each element of a to Reporter's stream
 void print(char c)
          print a character to the associated stream
 void print(java.lang.String s)
          print a string to the associated stream
 void println()
          print the newline character '\n' to the associated stream
 void println(java.lang.String s)
          print a string followed by the newline character '\n' to the associated stream; if notime is false prefix output with time information.
 void report(java.lang.String s)
          same as print(s) except rethrows InterruptedException if necessary
 void reportln(java.lang.String s)
          same as report(s + "\n");
 void setFile(java.lang.String filename)
          associate the Reporter with the FileOuputStram for filename or if filename is euqal to null associate with System.out
 boolean setNoTime(boolean noTime)
          Reporter uses the noTime value to determine whether to print timing information
 void startTimer()
          reset the starttime of the timer to the current time
 java.io.PrintStream stream()
          the streem this reporter is currently associated with
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRACE

public static int TRACE
Constructor Detail

Reporter

public Reporter()
construct with System.out stream and notime == true


Reporter

public Reporter(java.io.PrintStream p)
construct with PrintStream p and notime == true


Reporter

public Reporter(java.io.PrintStream p,
                boolean notime)
construct with PrintStream p and notime

Method Detail

adjustTimer

public void adjustTimer(long delta)
UNDOCUMNETED


flush

public void flush()
flush the Reporter's stream


interrupt

public void interrupt()

print_array

public void print_array(java.lang.String name,
                        double[] a)
print lines "name[i] = a[i]" for each element of a to Reporter's stream


print_array

public void print_array(java.lang.String name,
                        int[] a)
print lines "name[i] = a[i]" for each element of a to Reporter's stream


print_array

public void print_array(java.lang.String name,
                        java.lang.Object[] a)
print lines "name[i] = a[i]" for each element of a to Reporter's stream


print_array

public void print_array(java.lang.String name,
                        java.lang.String[] a)
print lines "name[i] = a[i]" for each element of a to Reporter's stream


print

public void print(char c)
           throws java.lang.InterruptedException
print a character to the associated stream

Throws:
java.lang.InterruptedException

print

public void print(java.lang.String s)
           throws java.lang.InterruptedException
print a string to the associated stream

Throws:
java.lang.InterruptedException

println

public void println()
             throws java.lang.InterruptedException
print the newline character '\n' to the associated stream

Throws:
java.lang.InterruptedException

println

public void println(java.lang.String s)
             throws java.lang.InterruptedException
print a string followed by the newline character '\n' to the associated stream; if notime is false prefix output with time information.

Throws:
java.lang.InterruptedException

report

public void report(java.lang.String s)
same as print(s) except rethrows InterruptedException if necessary


reportln

public void reportln(java.lang.String s)
same as report(s + "\n");


setFile

public void setFile(java.lang.String filename)
associate the Reporter with the FileOuputStram for filename or if filename is euqal to null associate with System.out


setNoTime

public boolean setNoTime(boolean noTime)
Reporter uses the noTime value to determine whether to print timing information

Returns:
previous noTime value
See Also:
println(), println(String s)

startTimer

public void startTimer()
reset the starttime of the timer to the current time


stream

public java.io.PrintStream stream()
the streem this reporter is currently associated with


QSopt 0.5 Alpha
QSopt Home