//\r
package com.stevesoft.pat.wrap;\r
\r
-import com.stevesoft.pat.*;\r
import java.io.*;\r
\r
+import com.stevesoft.pat.*;\r
+\r
/** Allows the outcome of a replaceAll() or replaceFirst()\r
to be directed to a Writer rather than a String.\r
<p>\r
This means that the return value of replaceAll() will\r
be null if this Object is used as the StringBufferLike.*/\r
public class WriterWrap\r
- implements BasicStringBufferLike\r
- {\r
+ implements BasicStringBufferLike\r
+{\r
Writer w;\r
- public WriterWrap(Writer w) {\r
+ public WriterWrap(Writer w)\r
+ {\r
this.w = w;\r
}\r
- public void append(char c) {\r
- try {\r
- w.write((int)c);\r
- } catch(IOException ioe) {}\r
+\r
+ public void append(char c)\r
+ {\r
+ try\r
+ {\r
+ w.write( (int) c);\r
+ }\r
+ catch (IOException ioe)\r
+ {}\r
}\r
- public void append(String s) {\r
- try {\r
+\r
+ public void append(String s)\r
+ {\r
+ try\r
+ {\r
w.write(s);\r
- } catch(IOException ioe) {}\r
+ }\r
+ catch (IOException ioe)\r
+ {}\r
}\r
\r
/** This operation can't really be done. */\r
- public StringLike toStringLike() {\r
+ public StringLike toStringLike()\r
+ {\r
return null;\r
}\r
\r
- public Object unwrap() {\r
+ public Object unwrap()\r
+ {\r
return w;\r
}\r
}\r