Package gnu.lists
Class FilterConsumer
- java.lang.Object
-
- gnu.lists.FilterConsumer
-
- All Implemented Interfaces:
Consumer
,XConsumer
,Appendable
,Consumer<Object>
,DoubleConsumer
,IntConsumer
,LongConsumer
- Direct Known Subclasses:
NamedChildrenFilter
,OrderedTuples
,RelativeStepFilter
,VoidConsumer
public class FilterConsumer extends Object implements XConsumer
A Consumer that wraps some other Consumer.
-
-
Field Summary
Fields Modifier and Type Field Description protected Object
attributeType
The 'attribute type' from the most recent startAttribute.protected Consumer
base
protected boolean
inAttribute
We seen a startAttribute but not the closing endAttribute.protected boolean
skipping
-
Constructor Summary
Constructors Constructor Description FilterConsumer(Consumer base)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Consumer
append(char c)
Consumer
append(CharSequence csq)
Consumer
append(CharSequence csq, int start, int end)
protected void
beforeContent()
protected void
beforeNode()
void
beginEntity(Object baseUri)
void
endAttribute()
End of an attribute or end of an actual parameter.void
endDocument()
void
endElement()
void
endEntity()
boolean
ignoring()
True if consumer is ignoring rest of element.void
startAttribute(Object attrType)
Write a attribute for the current element.void
startDocument()
void
startElement(Object type)
void
write(char[] buf, int off, int len)
void
write(int v)
void
write(CharSequence str, int start, int length)
void
write(String str)
void
writeBoolean(boolean v)
void
writeCDATA(char[] chars, int offset, int length)
void
writeComment(char[] chars, int offset, int length)
void
writeDouble(double v)
void
writeFloat(float v)
void
writeInt(int v)
void
writeLong(long v)
void
writeObject(Object v)
void
writeProcessingInstruction(String target, char[] content, int offset, int length)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.function.DoubleConsumer
andThen
-
Methods inherited from interface java.util.function.IntConsumer
andThen
-
Methods inherited from interface java.util.function.LongConsumer
andThen
-
-
-
-
Constructor Detail
-
FilterConsumer
public FilterConsumer(Consumer base)
-
-
Method Detail
-
beforeContent
protected void beforeContent()
-
beforeNode
protected void beforeNode()
-
writeBoolean
public void writeBoolean(boolean v)
- Specified by:
writeBoolean
in interfaceConsumer
-
writeFloat
public void writeFloat(float v)
- Specified by:
writeFloat
in interfaceConsumer
-
writeDouble
public void writeDouble(double v)
- Specified by:
writeDouble
in interfaceConsumer
-
startDocument
public void startDocument()
- Specified by:
startDocument
in interfaceConsumer
-
endDocument
public void endDocument()
- Specified by:
endDocument
in interfaceConsumer
-
startElement
public void startElement(Object type)
- Specified by:
startElement
in interfaceConsumer
-
endElement
public void endElement()
- Specified by:
endElement
in interfaceConsumer
-
startAttribute
public void startAttribute(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 interfaceConsumer
-
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 interfaceConsumer
-
writeComment
public void writeComment(char[] chars, int offset, int length)
- Specified by:
writeComment
in interfaceXConsumer
-
writeProcessingInstruction
public void writeProcessingInstruction(String target, char[] content, int offset, int length)
- Specified by:
writeProcessingInstruction
in interfaceXConsumer
-
writeCDATA
public void writeCDATA(char[] chars, int offset, int length)
- Specified by:
writeCDATA
in interfaceXConsumer
-
beginEntity
public void beginEntity(Object baseUri)
- Specified by:
beginEntity
in interfaceXConsumer
-
writeObject
public void writeObject(Object v)
- Specified by:
writeObject
in interfaceConsumer
-
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.
-
write
public void write(CharSequence str, int start, int length)
-
append
public Consumer append(char c)
- Specified by:
append
in interfaceAppendable
- Specified by:
append
in interfaceConsumer
-
append
public Consumer append(CharSequence csq)
- Specified by:
append
in interfaceAppendable
- Specified by:
append
in interfaceConsumer
-
append
public Consumer append(CharSequence csq, int start, int end)
- Specified by:
append
in interfaceAppendable
- Specified by:
append
in interfaceConsumer
-
-