SQLFire 1.1

com.vmware.sqlfire.callbacks
Class StringPrintWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.PrintWriter
          extended by com.vmware.sqlfire.callbacks.StringPrintWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class StringPrintWriter
extends PrintWriter

A PrintWriter that collects its output in a string builder, which can then be used to construct a string. This completely avoids any locking etc.


Constructor Summary
StringPrintWriter()
          Create a new string writer using the default initial string-buffer size.
StringPrintWriter(StringBuilder sb)
          Create a new string writer using the specified string-builder.
 
Method Summary
 StringPrintWriter append(char c)
           
 StringPrintWriter append(CharSequence csq)
           
 StringPrintWriter append(CharSequence csq, int start, int end)
           
 void close()
           
 void flush()
           
 StringBuilder getBuilder()
          Return the string builder itself.
 void print(boolean b)
           
 void print(char[] s)
           
 void print(double d)
           
 void print(float f)
           
 void print(int i)
           
 void print(long l)
           
 void print(Object obj)
           
 void print(String s)
           
 void println()
           
 void println(boolean b)
           
 void println(char[] s)
           
 void println(double d)
           
 void println(float f)
           
 void println(int i)
           
 void println(long l)
           
 void println(Object obj)
           
 void println(String s)
           
 String toString()
          Return the builder's current value as a string.
 void write(char[] cbuf)
           
 void write(char[] cbuf, int off, int len)
           
 void write(int c)
           
 void write(String str)
           
 void write(String str, int off, int len)
           
 
Methods inherited from class java.io.PrintWriter
checkError, format, format, print, printf, printf, println
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringPrintWriter

public StringPrintWriter()
Create a new string writer using the default initial string-buffer size.


StringPrintWriter

public StringPrintWriter(StringBuilder sb)
Create a new string writer using the specified string-builder.

Parameters:
sb - the StringBuilder to use as the internal buffer
Method Detail

write

public void write(int c)
Overrides:
write in class PrintWriter

write

public void write(char[] cbuf)
Overrides:
write in class PrintWriter

write

public void write(char[] cbuf,
                  int off,
                  int len)
Overrides:
write in class PrintWriter

write

public void write(String str)
Overrides:
write in class PrintWriter

write

public void write(String str,
                  int off,
                  int len)
Overrides:
write in class PrintWriter

print

public void print(boolean b)
Overrides:
print in class PrintWriter

print

public void print(int i)
Overrides:
print in class PrintWriter

print

public void print(long l)
Overrides:
print in class PrintWriter

print

public void print(float f)
Overrides:
print in class PrintWriter

print

public void print(double d)
Overrides:
print in class PrintWriter

print

public void print(char[] s)
Overrides:
print in class PrintWriter

print

public void print(String s)
Overrides:
print in class PrintWriter

print

public void print(Object obj)
Overrides:
print in class PrintWriter

println

public void println()
Overrides:
println in class PrintWriter

println

public void println(boolean b)
Overrides:
println in class PrintWriter

println

public void println(int i)
Overrides:
println in class PrintWriter

println

public void println(long l)
Overrides:
println in class PrintWriter

println

public void println(float f)
Overrides:
println in class PrintWriter

println

public void println(double d)
Overrides:
println in class PrintWriter

println

public void println(char[] s)
Overrides:
println in class PrintWriter

println

public void println(String s)
Overrides:
println in class PrintWriter

println

public void println(Object obj)
Overrides:
println in class PrintWriter

append

public StringPrintWriter append(char c)
Specified by:
append in interface Appendable
Overrides:
append in class PrintWriter

append

public StringPrintWriter append(CharSequence csq)
Specified by:
append in interface Appendable
Overrides:
append in class PrintWriter

append

public StringPrintWriter append(CharSequence csq,
                                int start,
                                int end)
Specified by:
append in interface Appendable
Overrides:
append in class PrintWriter

toString

public String toString()
Return the builder's current value as a string.

Overrides:
toString in class Object

getBuilder

public StringBuilder getBuilder()
Return the string builder itself.


flush

public void flush()
Specified by:
flush in interface Flushable
Overrides:
flush in class PrintWriter

close

public void close()
Specified by:
close in interface Closeable
Overrides:
close in class PrintWriter

SQLFire 1.1

Copyright © 2010-2013 VMware, Inc. All rights reserved.