gnu.lists
Interface Consumer

All Superinterfaces:
java.lang.Appendable
All Known Subinterfaces:
XConsumer
All Known Implementing Classes:
CharArrayOutPort, ContentConsumer, FilterConsumer, HttpPrinter, KawaXMLReader, NamedChildrenFilter, Nodes, NodeTree, OrderedTuples, OutPort, PrintConsumer, ServletPrinter, SortedNodes, TreeList, Values, ValueStack, VoidConsumer, XMLPrinter, XslTranslator

public interface Consumer
extends java.lang.Appendable

A Consumer is something that will accept data (output), and do something with it. A consumer is like a SAX DocumentHandler or a PrintWriter, but more abstract. If a Sequence class impleemnts Consumer, then data "written" to the sequence will be inserted in the sequence.

Note: This interface is not quite final. For example it is probable we will add methods for comments, processing instructions, etc.


Method Summary
 Consumer append(char c)
           
 Consumer append(java.lang.CharSequence csq)
           
 Consumer append(java.lang.CharSequence csq, int start, int end)
           
 void beginAttribute(java.lang.String attrName, java.lang.Object attrType)
          Write a attribute for the current group.
 void beginDocument()
           
 void beginGroup(java.lang.String typeName, java.lang.Object type)
           
 void endAttribute()
           
 void endDocument()
           
 void endGroup(java.lang.String typeName)
           
 boolean ignoring()
          True if consumer is ignoring rest of group.
 void write(char[] buf, int off, int len)
           
 void writeBoolean(boolean v)
           
 void writeChar(int v)
           
 void writeChars(java.lang.String str)
           
 void writeDouble(double v)
           
 void writeFloat(float v)
           
 void writeInt(int v)
           
 void writeLong(long v)
           
 void writeObject(java.lang.Object v)
           
 

Method Detail

writeChar

void writeChar(int v)

writeBoolean

void writeBoolean(boolean v)

writeFloat

void writeFloat(float v)

writeDouble

void writeDouble(double v)

writeInt

void writeInt(int v)

writeLong

void writeLong(long v)

beginDocument

void beginDocument()

endDocument

void endDocument()

beginGroup

void beginGroup(java.lang.String typeName,
                java.lang.Object type)

endGroup

void endGroup(java.lang.String typeName)

beginAttribute

void beginAttribute(java.lang.String attrName,
                    java.lang.Object attrType)
Write a attribute for the current group. This is only allowed immediately after a beginGroup.


endAttribute

void endAttribute()

writeObject

void writeObject(java.lang.Object v)

ignoring

boolean ignoring()
True if consumer is ignoring rest of group. The producer can use this information to skip ahead.


writeChars

void writeChars(java.lang.String str)

write

void write(char[] buf,
           int off,
           int len)

append

Consumer append(char c)
Specified by:
append in interface java.lang.Appendable

append

Consumer append(java.lang.CharSequence csq)
Specified by:
append in interface java.lang.Appendable

append

Consumer append(java.lang.CharSequence csq,
                int start,
                int end)
Specified by:
append in interface java.lang.Appendable