Class Interceptor

java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.PrintStream
nz.ac.vuw.ecs.swen225.gp6.persistency.Interceptor
All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable

public class Interceptor extends PrintStream
Class for intercepting System.out calls. Handles the output streams and redirects all outputs to:

1. Normal output

2. In-game log panel display

3. Log file in /res

  • Constructor Details

    • Interceptor

      public Interceptor(OutputStream out)
      Constructor for the Interceptor class.
      Parameters:
      out - The output stream
  • Method Details

    • print

      public void print(String s)
      Print a string to the output stream.
      Overrides:
      print in class PrintStream
      Parameters:
      s - The string to print
    • println

      public void println(String s)
      Print a line to the output stream.
      Overrides:
      println in class PrintStream
      Parameters:
      s - The string to print
    • printf

      public PrintStream printf(String format, Object... args)
      Print a format string to the output stream.
      Overrides:
      printf in class PrintStream
      Parameters:
      format - The format string
      args - The arguments