/Users/lyon/j4p/src/futils/Print.java

1    package futils; 
2     
3    import java.io.PrintStream; 
4     
5    public final class Print { 
6     
7        // prevent instantiation 
8        private Print() { 
9        } 
10    
11       private static PrintStream output = System.out; 
12    
13       public static void setPrintStream(PrintStream ps) { 
14           output = ps; 
15       } 
16    
17       public static PrintStream getPrintStream() { 
18           return output; 
19       } 
20    
21    
22       public static void d(double i) { 
23           Print.output.print(i + "\t"); 
24       } 
25    
26    
27       public static void ln(double d) { 
28           Print.output.println(d); 
29       } 
30    
31       public static void ln(String str) { 
32           Print.output.println(str); 
33       } 
34    
35       public static void print(String str) { 
36           Print.output.print(str); 
37       } 
38    
39       public static void print(double d) { 
40           Print.output.print(d); 
41       } 
42    
43       public static void print(int d) { 
44           Print.output.print(d); 
45       } 
46    
47    
48       public static void className(Object o) { 
49           Print.output.print(o.getClass().getName() + "\t"); 
50       } 
51   }