org.erights.e.elib.oldeio
Class TextWriter

java.lang.Object
  |
  +--java.io.Writer
        |
        +--java.io.FilterWriter
              |
              +--org.erights.e.elib.oldeio.TextWriter

public final class TextWriter
extends FilterWriter

Safe:


Field Summary
private static String DEFAULT_PREFIX
           
private  boolean myAutoflush
           
private  boolean myCloses
           
private  FlexMap myContext
           
private  String myNewline
           
 
Fields inherited from class java.io.FilterWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
TextWriter(Writer out)
          Enabled: Initial newline defaults to "\n".
TextWriter(Writer out, boolean autoflush)
          Enabled: Initial newline defaults to "\n".
TextWriter(Writer out, String newline, boolean autoflush, boolean closes, FlexMap optContext)
          Enabled: Returns a writer that wraps 'out', and writes all strings with "\n" replaced with the 'newline' string.
 
Method Summary
 void __printOn(TextWriter out)
          Enabled: A TextWriter prints itself on a TextWriter as <TextWriter>.
 void close()
          Enabled: XXX Does NOT close the underlying stream, since that might be separately accessed.
 TextWriter indent()
          Enabled: morePrefix defaults to four spaces
 TextWriter indent(String morePrefix)
          Enabled: Returns a new TextWriter just like this one, but with morePrefix added on.
 void lnPrint(Object obj)
          Enabled: Like println(), but does the newline & prefix first
static Object[] makeBufferingPair()
          Enabled: Returns a pair of a TextWriter and the StringBuffer it writes into.
 void print(Object original)
          Enabled: Like PrintWriter.print(), but doesn't suppress IOExceptions
 void print(Object a, Object b)
          Enabled:
 void print(Object a, Object b, Object c)
          Enabled:
 void print(Object a, Object b, Object c, Object d)
          Enabled:
 void print(Object a, Object b, Object c, Object d, Object e)
          Enabled:
 void print(Object a, Object b, Object c, Object d, Object e, Object f)
          Enabled:
 void print(Object a, Object b, Object c, Object d, Object e, Object f, Object g)
          Enabled:
 void printAll(Object[] objs)
          Enabled:
 void println()
          Enabled: Like PrintWriter.println(), but uses our own newline, and doesn't suppress IOExceptions.
 void println(Object obj)
          Enabled: Like PrintWriter.println(), but doesn't suppress IOExceptions
 void quote(Object original)
          Enabled: quote(obj) differs from print(obj) in that the quoted form of the object is printed.
 void write(char[] cbuf, int off, int len)
          Enabled:
 void write(int c)
          Enabled:
 void write(String str, int off, int len)
          Enabled:
 
Methods inherited from class java.io.FilterWriter
flush
 
Methods inherited from class java.io.Writer
write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PREFIX

private static final String DEFAULT_PREFIX

myNewline

private final String myNewline

myAutoflush

private final boolean myAutoflush

myCloses

private final boolean myCloses

myContext

private final FlexMap myContext
Constructor Detail

TextWriter

public TextWriter(Writer out)
Enabled: Initial newline defaults to "\n". autoflush and closes default to false.


TextWriter

public TextWriter(Writer out,
                  boolean autoflush)
Enabled: Initial newline defaults to "\n". closes default to false.


TextWriter

public TextWriter(Writer out,
                  String newline,
                  boolean autoflush,
                  boolean closes,
                  FlexMap optContext)
Enabled: Returns a writer that wraps 'out', and writes all strings with "\n" replaced with the 'newline' string.

If autoflush, flush()es after outputting each newline.

Method Detail

makeBufferingPair

public static Object[] makeBufferingPair()
Enabled: Returns a pair of a TextWriter and the StringBuffer it writes into.


close

public void close()
           throws IOException
Enabled: XXX Does NOT close the underlying stream, since that might be separately accessed. Does flush and invalidate this TextWriter.

Overrides:
close in class FilterWriter
IOException

indent

public TextWriter indent()
Enabled: morePrefix defaults to four spaces


indent

public TextWriter indent(String morePrefix)
Enabled: Returns a new TextWriter just like this one, but with morePrefix added on. Note that these share the context used to break cycles.


print

public void print(Object original)
           throws IOException
Enabled: Like PrintWriter.print(), but doesn't suppress IOExceptions

IOException

quote

public void quote(Object original)
           throws IOException
Enabled: quote(obj) differs from print(obj) in that the quoted form of the object is printed. Currently, the quoted & non quoted printed forms differ only for String and Twine.

IOException

printAll

public void printAll(Object[] objs)
              throws IOException
Enabled:

IOException

print

public void print(Object a,
                  Object b)
           throws IOException
Enabled:

IOException

print

public void print(Object a,
                  Object b,
                  Object c)
           throws IOException
Enabled:

IOException

print

public void print(Object a,
                  Object b,
                  Object c,
                  Object d)
           throws IOException
Enabled:

IOException

print

public void print(Object a,
                  Object b,
                  Object c,
                  Object d,
                  Object e)
           throws IOException
Enabled:

IOException

print

public void print(Object a,
                  Object b,
                  Object c,
                  Object d,
                  Object e,
                  Object f)
           throws IOException
Enabled:

IOException

print

public void print(Object a,
                  Object b,
                  Object c,
                  Object d,
                  Object e,
                  Object f,
                  Object g)
           throws IOException
Enabled:

IOException

lnPrint

public void lnPrint(Object obj)
             throws IOException
Enabled: Like println(), but does the newline & prefix first

IOException

println

public void println()
             throws IOException
Enabled: Like PrintWriter.println(), but uses our own newline, and doesn't suppress IOExceptions.

IOException

println

public void println(Object obj)
             throws IOException
Enabled: Like PrintWriter.println(), but doesn't suppress IOExceptions

IOException

write

public void write(char[] cbuf,
                  int off,
                  int len)
           throws IOException
Enabled:

Overrides:
write in class FilterWriter
Parameters:
cbuf - Buffer of characters to be written
off - Offset from which to start reading characters
len - Number of characters to be written
IOException

write

public void write(int c)
           throws IOException
Enabled:

Overrides:
write in class FilterWriter
Parameters:
c - int specifying a character to be written.
IOException

write

public void write(String str,
                  int off,
                  int len)
           throws IOException
Enabled:

Overrides:
write in class FilterWriter
Parameters:
str - String to be written
off - Offset from which to start reading characters
len - Number of characters to be written
IOException

__printOn

public void __printOn(TextWriter out)
               throws IOException
Enabled: A TextWriter prints itself on a TextWriter as <TextWriter>.

IOException


comments?