Package gnu.xquery.util
Class OrderedTuples
- java.lang.Object
-
- gnu.lists.FilterConsumer
-
- gnu.xquery.util.OrderedTuples
-
- All Implemented Interfaces:
Consumer
,XConsumer
,Appendable
,Consumer<Object>
,DoubleConsumer
,IntConsumer
,LongConsumer
public class OrderedTuples extends FilterConsumer
Helper class used in conjunction withOrderedMap
. It has the tuples from thefor
andlet
-clauses, as filtered by thewhere
-clause. The tuples are sorted using a linked-list version of merge sort. The sequence of n tuples for m variables is represented using an array of length n where each element is an array of length m. A possible future optimization would be to instead use m different arrays of of length n. The advantage is that each of the M arrays could have the "correct" type for each variable, and so we avoid casts or boxing/unboxing.
-
-
Field Summary
-
Fields inherited from class gnu.lists.FilterConsumer
attributeType, base, inAttribute, skipping
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
ignoring()
True if consumer is ignoring rest of element.static OrderedTuples
make$V(Procedure body, Object[] comps)
void
run$X(CallContext ctx)
void
writeObject(Object v)
-
Methods inherited from class gnu.lists.FilterConsumer
append, append, append, beforeContent, beforeNode, beginEntity, endAttribute, endDocument, endElement, endEntity, startAttribute, startDocument, startElement, write, write, write, write, writeBoolean, writeCDATA, writeComment, writeDouble, writeFloat, writeInt, writeLong, writeProcessingInstruction
-
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
-
-
-
-
Method Detail
-
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.- Specified by:
ignoring
in interfaceConsumer
- Overrides:
ignoring
in classFilterConsumer
-
writeObject
public void writeObject(Object v)
- Specified by:
writeObject
in interfaceConsumer
- Overrides:
writeObject
in classFilterConsumer
-
make$V
public static OrderedTuples make$V(Procedure body, Object[] comps)
-
run$X
public void run$X(CallContext ctx) throws Throwable
- Throws:
Throwable
-
-