gnu.xquery.util
Class OrderedTuples

java.lang.Object
  extended by gnu.lists.FilterConsumer
      extended by gnu.xquery.util.OrderedTuples
All Implemented Interfaces:
Consumer, java.lang.Appendable

public class OrderedTuples
extends FilterConsumer

Helper class used in conjunction with OrderedMap. It has the tuples from the for and let-clauses, as filtered by the where-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
base, skipping
 
Method Summary
static OrderedTuples make$V(Procedure body, java.lang.Object[] comps)
           
 void run$X(CallContext ctx)
           
 void writeObject(java.lang.Object v)
           
 
Methods inherited from class gnu.lists.FilterConsumer
append, append, append, beginAttribute, beginDocument, beginGroup, endAttribute, endDocument, endGroup, ignoring, write, writeBoolean, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

writeObject

public void writeObject(java.lang.Object v)
Specified by:
writeObject in interface Consumer
Overrides:
writeObject in class FilterConsumer

make$V

public static OrderedTuples make$V(Procedure body,
                                   java.lang.Object[] comps)

run$X

public void run$X(CallContext ctx)
           throws java.lang.Throwable
Throws:
java.lang.Throwable