2 // This software is now distributed according to
\r
3 // the Lesser Gnu Public License. Please see
\r
4 // http://www.gnu.org/copyleft/lesser.txt for
\r
6 // -- Happy Computing!
\r
8 package com.stevesoft.pat.wrap;
\r
10 import com.stevesoft.pat.*;
\r
13 /** Allows the outcome of a replaceAll() or replaceFirst()
\r
14 to be directed to a Writer rather than a String.
\r
16 The method toStringLike() cannot work, however.
\r
17 This means that the return value of replaceAll() will
\r
18 be null if this Object is used as the StringBufferLike.*/
\r
19 public class WriterWrap
\r
20 implements BasicStringBufferLike
\r
23 public WriterWrap(Writer w) {
\r
26 public void append(char c) {
\r
29 } catch(IOException ioe) {}
\r
31 public void append(String s) {
\r
34 } catch(IOException ioe) {}
\r
37 /** This operation can't really be done. */
\r
38 public StringLike toStringLike() {
\r
42 public Object unwrap() {
\r