lux
Class Optimizer

java.lang.Object
  extended by net.sf.saxon.expr.parser.Optimizer
      extended by lux.Optimizer
All Implemented Interfaces:
Serializable

public class Optimizer
extends net.sf.saxon.expr.parser.Optimizer

This Optimizer provides asserts that search results are sorted in document order (when they are), so they don't have to be re-sorted by Saxon. For use with Saxon HE only: PE/EE provide their own, and the optimization provided here is not compatible with those. There is no need for users of these classes to create this explicitly - it is managed by Evaluator.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sf.saxon.expr.parser.Optimizer
config, FULL_OPTIMIZATION, NO_OPTIMIZATION
 
Constructor Summary
Optimizer(net.sf.saxon.Configuration config, SaxonTranslator translator)
           
 
Method Summary
 net.sf.saxon.expr.Expression makeConditionalDocumentSorter(net.sf.saxon.expr.sort.DocumentSorter sorter, net.sf.saxon.expr.SlashExpression path)
          Make a conditional document sorter.
 
Methods inherited from class net.sf.saxon.expr.parser.Optimizer
compileToByteCode, convertPathExpressionToKey, convertToFilterExpression, extractGlobalVariables, generateMultithreadedInstruction, getConfiguration, getOptimizationLevel, isIndexableFilter, isVariableReplaceableByDot, makeCastableToList, makeCastableToUnion, makeCastToList, makeCastToUnion, makeCopyOperationsExplicit, makeIndexedValue, makeInversion, makeOuterForExpression, makeStreamingApplyTemplates, optimizeCopy, optimizeForExpressionForStreaming, optimizeGeneralComparison, optimizeQuantifiedExpressionForStreaming, promoteExpressionsToGlobal, setOptimizationLevel, trace, trace, tryIndexedFilter, tryInlineFunctionCall, trySwitch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Optimizer

public Optimizer(net.sf.saxon.Configuration config,
                 SaxonTranslator translator)
Method Detail

makeConditionalDocumentSorter

public net.sf.saxon.expr.Expression makeConditionalDocumentSorter(net.sf.saxon.expr.sort.DocumentSorter sorter,
                                                                  net.sf.saxon.expr.SlashExpression path)
Make a conditional document sorter. This optimization is attempted when a DocumentSorter is wrapped around a path expression. Saxon-HE doesn't provide any optimizations of this sort, but this is critical for lux:search expressions since they may potentially return a huge number of unused documents.

Overrides:
makeConditionalDocumentSorter in class net.sf.saxon.expr.parser.Optimizer
Parameters:
sorter - the document sorter
path - the path expression
Returns:
the path expression, if it is proven to be in document order, or the original sorter unchanged when no such optimization is possible


Copyright © 2013. All Rights Reserved.