gnu.lists

Interface Consumer

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
voidendAttribute()
End of an attribute or end of an actual parameter.
voidendDocument()
voidendElement()
booleanignoring()
True if consumer is ignoring rest of element.
voidstartAttribute(Object attrType)
Write a attribute for the current element.
voidstartDocument()
voidstartElement(Object type)
voidwrite(int ch)
voidwrite(String string)
voidwrite(CharSequence string, int start, int length)
voidwrite(char[] buf, int start, int length)
voidwriteBoolean(boolean v)
voidwriteDouble(double v)
voidwriteFloat(float v)
voidwriteInt(int v)
voidwriteLong(long v)
voidwriteObject(Object v)

Method Detail

endAttribute

public void endAttribute()
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.

endDocument

public void endDocument()

endElement

public void endElement()

ignoring

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

startAttribute

public void startAttribute(Object attrType)
Write a attribute for the current element. This is only allowed immediately after a startElement.

startDocument

public void startDocument()

startElement

public void startElement(Object type)

write

public void write(int ch)

write

public void write(String string)

write

public void write(CharSequence string, int start, int length)

write

public void write(char[] buf, int start, int length)

writeBoolean

public void writeBoolean(boolean v)

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)