gnu.xquery.util
Class RelativeStepFilter
java.lang.Object
gnu.lists.FilterConsumer
gnu.xquery.util.RelativeStepFilter
- All Implemented Interfaces:
- Consumer, PositionConsumer, java.lang.Appendable
public class RelativeStepFilter
- extends FilterConsumer
- implements PositionConsumer
Used to filter the output of RelativeStep.
Atomic values are passed though as-is, while node values are sorted
by document order and duplicates removed. An exception is thrown
if there is a mix of atoms and nodes.
Informally: E1/E2
is implemented as:
RelativeStepFilter(for $dot in E1 return E2)
.
Methods inherited from class gnu.lists.FilterConsumer |
append, append, append, endAttribute, endDocument, endElement, ignoring, startAttribute, startDocument, startElement, write, write, write, write, writeBoolean, writeDouble, writeFloat, writeInt, writeLong |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RelativeStepFilter
public RelativeStepFilter(Consumer base)
consume
public void consume(SeqPosition position)
- Description copied from interface:
PositionConsumer
- Consume node at current position.
The caller may invalidate or change the position after consume returns,
so if the consumer wants to save it, it needs to copy it.
- Specified by:
consume
in interface PositionConsumer
writeObject
public void writeObject(java.lang.Object v)
- Specified by:
writeObject
in interface Consumer
- Overrides:
writeObject
in class FilterConsumer
beforeContent
protected void beforeContent()
- Overrides:
beforeContent
in class FilterConsumer
writePosition
public void writePosition(AbstractSequence seq,
int ipos)
- Description copied from interface:
PositionConsumer
- Consume a single position pair.
This PositionConsumer may assume the sequence does no reference
management; i.e. that copyPos is trivial and releasePos is
a no-op. If that is not the case, use consume(TreePosition) instead.
- Specified by:
writePosition
in interface PositionConsumer
finish
public void finish()