Class SortKeyDefinitionList

All Implemented Interfaces:
Iterable<SortKeyDefinition>, ExportAgent, Locatable, IdentityComparable, Traceable

public class SortKeyDefinitionList extends PseudoExpression implements Iterable<SortKeyDefinition>
The class represents a list of sort key definitions in major-to-minor sort key order. It is not a true expression, because it cannot be evaluated, but it acts as a node in the expression tree, and is therefore classified as a pseudo-expression.
  • Constructor Details

    • SortKeyDefinitionList

      public SortKeyDefinitionList(SortKeyDefinition[] sortKeyDefinitions)
      Create a list of sort key definitions
      Parameters:
      sortKeyDefinitions - the sort key definitions, supplied as an array
  • Method Details

    • operands

      public Iterable<Operand> operands()
      Get the operands of this SortKeyDefinitionList, treating it as a pseudo-expression.
      Overrides:
      operands in class Expression
      Returns:
      the operands: specifically, the contained sort key definitions, each of which is also treated as a pseudo-expression.
    • isLiftable

      public boolean isLiftable(boolean forStreaming)
      Ask whether the expression can be lifted out of a loop, assuming it has no dependencies on the controlling variable/focus of the loop
      Overrides:
      isLiftable in class Expression
      Parameters:
      forStreaming - true if we're optimising for streamed execution
      Returns:
      for a SortKeyDefinitionList, always false
    • size

      public int size()
      Ask how many sort key definitions there are
      Returns:
      the number of sort key definitions in the list (always one or more)
    • getSortKeyDefinition

      public SortKeyDefinition getSortKeyDefinition(int i)
      Get the i'th sort key definition, counting from zero
      Parameters:
      i - the index of the required sort key definition
      Returns:
      the required sort key definition
    • iterator

      public Iterator<SortKeyDefinition> iterator()
      Get an iterator over the sort key definitions
      Specified by:
      iterator in interface Iterable<SortKeyDefinition>
      Returns:
      an iterator over the sort key definitions
    • copy

      public SortKeyDefinitionList copy(RebindingMap rebindings)
      Copy this pseudo-expression
      Specified by:
      copy in class Expression
      Parameters:
      rebindings - the rebinding map
      Returns:
      a deep copy
    • getImplementationMethod

      public int getImplementationMethod()
      An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process(). This method indicates which of these methods is provided directly. The other methods will always be available indirectly, using an implementation that relies on one of the other methods.
      Overrides:
      getImplementationMethod in class PseudoExpression
      Returns:
      the implementation method, for example Expression.ITERATE_METHOD or Expression.EVALUATE_METHOD or Expression.PROCESS_METHOD
    • export

      public void export(ExpressionPresenter out) throws XPathException
      Description copied from class: Expression
      Diagnostic print of expression structure. The abstract expression tree is written to the supplied output destination.
      Specified by:
      export in interface ExportAgent
      Specified by:
      export in class Expression
      Parameters:
      out - the expression presenter used to display the structure
      Throws:
      XPathException - if the export fails, for example if an expression is found that won't work in the target environment.