Package gnu.lists
Interface Consumer
- All Superinterfaces:
Appendable,Consumer<Object>,DoubleConsumer,IntConsumer,LongConsumer
- All Known Subinterfaces:
XConsumer
- All Known Implementing Classes:
ContentConsumer,FilterConsumer,HttpPrinter,KawaXMLReader,NamedChildrenFilter,Nodes,NodeTree,OrderedTuples,PrintConsumer,RelativeStepFilter,ServletPrinter,SortedNodes,TreeList,Values.FromTreeList,VoidConsumer,XMLFilter,XMLPrinter,XslTranslator
public interface Consumer
extends Appendable, Consumer<Object>, IntConsumer, LongConsumer, DoubleConsumer
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
Modifier and TypeMethodDescriptiondefault voidaccept(double t) default voidaccept(int t) default voidaccept(long t) default voidappend(char c) append(CharSequence csq) append(CharSequence csq, int start, int end) voidEnd of an attribute or end of an actual parameter.voidvoidbooleanignoring()True if consumer is ignoring rest of element.voidstartAttribute(Object attrType) Write a attribute for the current element.voidvoidstartElement(Object type) voidwrite(char[] buf, int start, int length) voidwrite(int ch) voidwrite(CharSequence string, int start, int length) voidvoidwriteBoolean(boolean v) voidwriteDouble(double v) voidwriteFloat(float v) voidwriteInt(int v) voidwriteLong(long v) voidMethods inherited from interface java.util.function.DoubleConsumer
andThenMethods inherited from interface java.util.function.IntConsumer
andThenMethods inherited from interface java.util.function.LongConsumer
andThen
-
Method Details
-
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) -
startDocument
void startDocument() -
endDocument
void endDocument() -
startElement
-
endElement
void endElement() -
startAttribute
Write a attribute for the current element. This is only allowed immediately after a startElement. -
endAttribute
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. -
writeObject
-
ignoring
boolean ignoring()True if consumer is ignoring rest of element. The producer can use this information to skip ahead. -
write
void write(int ch) -
write
-
write
-
write
void write(char[] buf, int start, int length) -
append
- Specified by:
appendin interfaceAppendable
-
append
- Specified by:
appendin interfaceAppendable
-
append
- Specified by:
appendin interfaceAppendable
-
accept
-
accept
default void accept(int t) - Specified by:
acceptin interfaceIntConsumer
-
accept
default void accept(long t) - Specified by:
acceptin interfaceLongConsumer
-
accept
default void accept(double t) - Specified by:
acceptin interfaceDoubleConsumer
-