gnu.lists
Class PrintConsumer

java.lang.Object
  extended by java.io.Writer
      extended by java.io.PrintWriter
          extended by gnu.lists.PrintConsumer
All Implemented Interfaces:
Consumer, java.io.Closeable, java.io.Flushable, java.lang.Appendable
Direct Known Subclasses:
OutPort

public class PrintConsumer
extends java.io.PrintWriter
implements Consumer

A Consumer that extends a PrintWriter. Useful for formatting.


Field Summary
 
Fields inherited from class java.io.PrintWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
PrintConsumer(Consumer out, boolean autoFlush)
           
PrintConsumer(java.io.OutputStream out, boolean autoFlush)
           
PrintConsumer(java.io.Writer out)
           
PrintConsumer(java.io.Writer out, boolean autoFlush)
           
 
Method Summary
 void endAttribute()
          End of an attribute or end of an actual parameter.
 void endDocument()
           
 void endElement()
           
protected  void endNumber()
           
 boolean ignoring()
          True if consumer is ignoring rest of element.
 void startAttribute(java.lang.Object attrType)
          Write a attribute for the current element.
 void startDocument()
           
 void startElement(java.lang.Object type)
           
protected  void startNumber()
           
 void write(java.lang.CharSequence csq, int start, int end)
           
 void writeBoolean(boolean v)
           
 void writeDouble(double v)
           
 void writeFloat(float v)
           
 void writeInt(int v)
           
 void writeLong(long v)
           
 void writeObject(java.lang.Object v)
           
 
Methods inherited from class java.io.PrintWriter
append, append, append, checkError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gnu.lists.Consumer
write, write, write
 

Constructor Detail

PrintConsumer

public PrintConsumer(Consumer out,
                     boolean autoFlush)

PrintConsumer

public PrintConsumer(java.io.OutputStream out,
                     boolean autoFlush)

PrintConsumer

public PrintConsumer(java.io.Writer out,
                     boolean autoFlush)

PrintConsumer

public PrintConsumer(java.io.Writer out)
Method Detail

startNumber

protected void startNumber()

endNumber

protected void endNumber()

write

public void write(java.lang.CharSequence csq,
                  int start,
                  int end)
Specified by:
write in interface Consumer

writeBoolean

public void writeBoolean(boolean v)
Specified by:
writeBoolean in interface Consumer

writeFloat

public void writeFloat(float v)
Specified by:
writeFloat in interface Consumer

writeDouble

public void writeDouble(double v)
Specified by:
writeDouble in interface Consumer

writeInt

public void writeInt(int v)
Specified by:
writeInt in interface Consumer

writeLong

public void writeLong(long v)
Specified by:
writeLong in interface Consumer

startDocument

public void startDocument()
Specified by:
startDocument in interface Consumer

endDocument

public void endDocument()
Specified by:
endDocument in interface Consumer

startElement

public void startElement(java.lang.Object type)
Specified by:
startElement in interface Consumer

endElement

public void endElement()
Specified by:
endElement in interface Consumer

startAttribute

public void startAttribute(java.lang.Object attrType)
Description copied from interface: Consumer
Write a attribute for the current element. This is only allowed immediately after a startElement.

Specified by:
startAttribute in interface Consumer

endAttribute

public void endAttribute()
Description copied from interface: Consumer
End of an attribute or end of an actual parameter. The former use matches a startAttribute; the latter may not, and can be used to separate parameters in a parameter list. This double duty suggsts the method should at least be re-named.

Specified by:
endAttribute in interface Consumer

writeObject

public void writeObject(java.lang.Object v)
Specified by:
writeObject in interface Consumer

ignoring

public boolean ignoring()
Description copied from interface: Consumer
True if consumer is ignoring rest of element. The producer can use this information to skip ahead.

Specified by:
ignoring in interface Consumer