1 17 18 package com.finalist.jag; 19 20 21 import com.finalist.jag.template.*; 22 23 24 31 public class JagTextBlockWriter extends JagWriter { 32 33 34 private TemplateTextBlock buffer = null; 35 36 37 42 public JagTextBlockWriter() { 43 buffer = new TemplateTextBlock(""); 44 } 45 46 47 54 public JagTextBlockWriter(TemplateTextBlock buffer) { 55 this.buffer = buffer; 56 } 57 58 59 62 public void clear() { 63 buffer.set(); 64 } 65 66 67 70 public void newLine() { 71 buffer.append(java.io.File.separator); 72 } 73 74 75 80 public void print(boolean b) { 81 buffer.append(new StringBuffer ().append(b)); 82 } 83 84 85 90 public void print(char c) { 91 buffer.append(new StringBuffer ().append(c)); 92 } 93 94 95 100 public void print(char[] s) { 101 buffer.append(new StringBuffer ().append(s)); 102 } 103 104 105 110 public void print(double d) { 111 buffer.append(new StringBuffer ().append(d)); 112 } 113 114 115 120 public void print(float f) { 121 buffer.append(new StringBuffer ().append(f)); 122 } 123 124 125 130 public void print(int i) { 131 buffer.append(new StringBuffer ().append(i)); 132 } 133 134 135 140 public void print(long l) { 141 buffer.append(new StringBuffer ().append(l)); 142 } 143 144 145 150 public void print(Object obj) { 151 buffer.append(new StringBuffer ().append(obj)); 152 } 153 154 155 160 public void print(String s) { 161 buffer.append(s); 162 } 163 164 165 168 public void println() { 169 newLine(); 170 } 171 172 173 178 public void println(boolean x) { 179 print(x); 180 newLine(); 181 } 182 183 184 189 public void println(char x) { 190 print(x); 191 newLine(); 192 } 193 194 195 200 public void println(char[] x) { 201 print(x); 202 newLine(); 203 } 204 205 206 211 public void println(double x) { 212 print(x); 213 newLine(); 214 } 215 216 217 222 public void println(float x) { 223 print(x); 224 newLine(); 225 } 226 227 228 233 public void println(int x) { 234 print(x); 235 newLine(); 236 } 237 238 239 244 public void println(long x) { 245 print(x); 246 newLine(); 247 } 248 249 250 255 public void println(Object x) { 256 print(x); 257 newLine(); 258 } 259 260 261 266 public void println(String x) { 267 print(x); 268 newLine(); 269 } 270 271 272 279 public void createNewFile(java.lang.String path) { 280 buffer.setFile(path); 281 } 282 283 284 291 public void createNewFile(java.lang.StringBuffer path) { 292 createNewFile(new String (path)); 293 } 294 } 295 296 ; | Popular Tags |