| java.lang.Object gnu.lists.FilterConsumer gnu.xquery.util.OrderedTuples
OrderedTuples | public class OrderedTuples extends FilterConsumer (Code) | | 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 | |
Procedure | body The return clause, encoded as a procedure on a tuple. | Object[] | comps The compator functions. | int | first | int | n The number of tuples. | int[] | next Used to chain the tuples after sorting.
I.e. | Object[] | tuples The sequence of tuples, in input (unsorted) order. |
body | Procedure body(Code) | | The return clause, encoded as a procedure on a tuple.
|
comps | Object[] comps(Code) | | The compator functions.
If there are k comparator, the array's length is 3*k.
comps[3*i] is the i'th comparison function
(represented as a procedure on a tuple);
comps[3*i+1] is the i'th set of flags encoded as a string;
and comps[3*i+2] is the i'th collator
(either null or a NamedCollator).
|
n | int n(Code) | | The number of tuples.
|
next | int[] next(Code) | | Used to chain the tuples after sorting.
I.e. if the i'th tuple (is sort order) is tuples[k],
then the (i+1)'the sorted tuple is tuples[next[k]].
The end of the list is indicated by -1.
|
tuples | Object[] tuples(Code) | | The sequence of tuples, in input (unsorted) order.
|
OrderedTuples | OrderedTuples()(Code) | | |
|
|