00001 package edu.ksu.cis.bandera.util;
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 import java.util.*;
00036 import java.io.*;
00037
00038 public class BanderaLog extends PrintStream {
00039 private PrintStream stdout = null;
00040 private PrintStream fileio = null;
00041 private boolean internal = false;
00042 protected boolean fails = false;
00043
00044
00045
00046
00047 public BanderaLog(java.io.OutputStream out) {
00048 super(out);
00049 }
00050
00051
00052
00053
00054
00055 public BanderaLog(java.io.OutputStream out, boolean autoFlush) {
00056 super(out, autoFlush);
00057 }
00058 public BanderaLog(PrintStream out, PrintStream f)
00059 {
00060 super(f); stdout = out; fileio = f;
00061 }
00062 public boolean isError() { return fails; }
00063 public void print(char[] s) { if (!internal) stdout.print(s); fileio.print(s); }
00064 public void print(char c) { if (!internal) stdout.print(c); fileio.print(c); }
00065 public void print(double d) { if (!internal) stdout.print(d); fileio.print(d); }
00066 public void print(float f) { if (!internal) stdout.print(f); fileio.print(f); }
00067 public void print(int i) { if (!internal) stdout.print(i); fileio.print(i); }
00068 public void print(long l) { if (!internal) stdout.print(l); fileio.print(l); }
00069 public void print(Object obj) { if (!internal) stdout.print(obj); fileio.print(obj); }
00070 public void print(String s) { if (!internal) stdout.print(s); fileio.print(s); }
00071 public void print(boolean b) { if (!internal) stdout.print(b); fileio.print(b); }
00072 public void println() { if (!internal) stdout.println(); fileio.println(); }
00073 public void println(char[] x) { if (!internal) stdout.println(x); fileio.println(x); }
00074 public void println(char x) { if (!internal) stdout.println(x); fileio.println(x); }
00075 public void println(double x) { if (!internal) stdout.println(x); fileio.println(x); }
00076 public void println(float x) { if (!internal) stdout.println(x); fileio.println(x); }
00077 public void println(int x) { if (!internal) stdout.println(x); fileio.println(x); }
00078 public void println(long x) { if (!internal) stdout.println(x); fileio.println(x); }
00079 public void println(Object x) { if (!internal) stdout.println(x); fileio.println(x); }
00080 public void println(String x) { if (!internal) stdout.println(x); fileio.println(x); }
00081 public void println(boolean x) { if (!internal) stdout.println(x); fileio.println(x); }
00082 protected void setError() { fails = true; }
00083 public void setInternal(boolean b) { internal = b; }
00084 public void write(byte[] buf, int off, int len) { if (!internal) stdout.write(buf,off,len); fileio.write(buf,off,len); }
00085 public void write(int b) { if (!internal) stdout.write(b); fileio.write(b); }
00086 }