gnu.lists

Interface Consumer

Known Subinterfaces:
XConsumer
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

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

void
beginAttribute(String attrName, Object attrType)
Write a attribute for the current group.
void
beginDocument()
void
beginGroup(String typeName, Object type)
void
endAttribute()
void
endDocument()
void
endGroup(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(String str)
void
writeDouble(double v)
void
writeFloat(float v)
void
writeInt(int v)
void
writeLong(long v)
void
writeObject(Object v)

Method Details

beginAttribute

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

beginDocument

public void beginDocument()

beginGroup

public void beginGroup(String typeName,
                       Object type)

endAttribute

public void endAttribute()

endDocument

public void endDocument()

endGroup

public void endGroup(String typeName)

ignoring

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

write

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

writeBoolean

public void writeBoolean(boolean v)

writeChar

public void writeChar(int v)

writeChars

public void writeChars(String str)

writeDouble

public void writeDouble(double v)

writeFloat

public void writeFloat(float v)

writeInt

public void writeInt(int v)

writeLong

public void writeLong(long v)

writeObject

public void writeObject(Object v)