Class OrderedMap

  • All Implemented Interfaces:
    Inlineable, Named

    public class OrderedMap
    extends MethodProc
    implements Inlineable
    A procedure used to represent a FLWOR expression with an order by clause. (ValuesMap is used for FLWOR expression that don't have an order by clause.) As returned by the parser:
     for $x1 in exp1, $x2 in exp2 where cond order by comparator1 ... return body
     
    is represented as
     ordered-map(tuple-sequence, body-function,
                 comparator-function1, flags1, collation1, ...)
     
    Here tuple-sequence is an expression that returns a sequence of tuples, which are currently implemnted as Java Object[] arrays. After inlining we get:
     ordered-map(tuple-sequence.
       OrderedTuples.make$V(body-function,
         new Object[]{comparator-function1, flags1, collation1, ...}))
     
    A future optimization would be to create an instance of a new sub-class of OrderedTuples. Then the body-function and comparator-functions could be compiled as methods to that class. That wins especially if it saves us having to create extra frame classes.