X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fcom%2Fstevesoft%2Fpat%2Fwrap%2FWriterWrap.java;h=1b7f6c25adf8ce0e8df35fec2d2d6825283143ba;hb=7bc226b58110fa26d9dbd3f0c78095d06909ffc3;hp=a1be479835f58171662519d4910cbe977ad958dc;hpb=dd74fc4938723fe5ec48d4e5fdcfbe58ac42a48d;p=jalview.git diff --git a/src/com/stevesoft/pat/wrap/WriterWrap.java b/src/com/stevesoft/pat/wrap/WriterWrap.java index a1be479..1b7f6c2 100755 --- a/src/com/stevesoft/pat/wrap/WriterWrap.java +++ b/src/com/stevesoft/pat/wrap/WriterWrap.java @@ -7,9 +7,10 @@ // package com.stevesoft.pat.wrap; -import com.stevesoft.pat.*; import java.io.*; +import com.stevesoft.pat.*; + /** Allows the outcome of a replaceAll() or replaceFirst() to be directed to a Writer rather than a String.

@@ -17,29 +18,42 @@ import java.io.*; This means that the return value of replaceAll() will be null if this Object is used as the StringBufferLike.*/ public class WriterWrap - implements BasicStringBufferLike - { + implements BasicStringBufferLike +{ Writer w; - public WriterWrap(Writer w) { + public WriterWrap(Writer w) + { this.w = w; } - public void append(char c) { - try { - w.write((int)c); - } catch(IOException ioe) {} + + public void append(char c) + { + try + { + w.write( (int) c); + } + catch (IOException ioe) + {} } - public void append(String s) { - try { + + public void append(String s) + { + try + { w.write(s); - } catch(IOException ioe) {} + } + catch (IOException ioe) + {} } /** This operation can't really be done. */ - public StringLike toStringLike() { + public StringLike toStringLike() + { return null; } - public Object unwrap() { + public Object unwrap() + { return w; } }