1 28 29 package org.objectweb.ccm.visitorIDL3.common; 30 31 40 41 public class PrintStream 42 { 43 49 52 private java.io.PrintStream stream_; 53 54 57 private String tabular_; 58 59 62 private int depth_; 63 64 67 private String name_; 68 69 72 private PrintStreamManager manager_; 73 74 80 88 public 89 PrintStream(java.io.PrintStream stream, 90 String tabular, 91 String name, 92 PrintStreamManager manager) 93 { 94 stream_ = stream; 96 tabular_ = tabular; 97 depth_ = 0; 98 name_ = name; 99 manager_ = manager; 100 } 101 102 108 111 public void 112 close() 113 { 114 stream_.close(); 115 } 116 117 122 public String 123 getName() 124 { 125 return name_; 126 } 127 128 133 public java.io.PrintStream 134 getStream() 135 { 136 return stream_; 137 } 138 139 144 public PrintStreamManager 145 getManager() 146 { 147 return manager_; 148 } 149 150 155 public String 156 getTab() 157 { 158 StringBuffer ret = new StringBuffer (""); 159 for(int i=0;i<depth_;i++) 160 ret.append(tabular_); 161 return ret.toString(); 162 } 163 164 167 public void 168 incDepth() 169 { 170 depth_++; 171 } 172 173 176 public void 177 decDepth() 178 { 179 depth_--; 180 } 181 182 185 public void 186 printTab() 187 { 188 for(int i=0; i<depth_; i++) 189 stream_.print(tabular_); 190 } 191 192 197 public void 198 print(String textLine) 199 { 200 printTab(); 201 stream_.print(textLine); 202 } 203 204 209 public void 210 println(String textLine) 211 { 212 printTab(); 213 stream_.println(textLine); 214 } 215 } 216 | Popular Tags |