Overview | Package | Class | Deprecated | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.sf.saxon.sort
Class DocumentSorter

    java.lang.Object
      net.sf.saxon.expr.Expression
          net.sf.saxon.expr.UnaryExpression
              net.sf.saxon.sort.DocumentSorter

All Implemented Interfaces:
  Serializable, SourceLocator, Container, EvaluableItem, SequenceIterable, InstructionInfoProvider

    public class DocumentSorter

extends UnaryExpression

A DocumentSorter is an expression that sorts a sequence of nodes into document order.

See Also:
  Serialized Form

Field Summary

Fields inherited from class net.sf.saxon.expr.Expression
`EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD`

Constructor Summary
`DocumentSorter(Expression base)`

Method Summary
`int` | `computeSpecialProperties()` Get the static properties of this expression (other than its type).
`boolean` | `effectiveBooleanValue(XPathContext context)` Get the effective boolean value of the expression.
`NodeOrderComparer` | `getComparer()`
`SequenceIterator` | `iterate(XPathContext context)` Return an Iterator to iterate over the values of a sequence.
`Expression` | `optimize(Optimizer opt, StaticContext env, ItemType contextItemType)` Perform optimisation of an expression and its subexpressions.
`Expression` | `promote(PromotionOffer offer)` Promote this expression if possible
`Expression` | `simplify(StaticContext env)` Simplify an expression

Methods inherited from class net.sf.saxon.expr.UnaryExpression
`computeCardinality, display, equals, getBaseExpression, getItemType, hashCode, iterateSubExpressions, replaceSubExpression, typeCheck`

Methods inherited from class net.sf.saxon.expr.Expression
`adoptChildExpression, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, evaluateAsString, evaluateItem, getCardinality, getColumnNumber, getContainingProcedure, getDependencies, getExecutable, getHostLanguage, getImplementationMethod, getInstructionInfo, getIntrinsicDependencies, getLineNumber, getLocationId, getLocationProvider, getParentExpression, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, hasBadParentPointer, markTailFunctionCalls, process, resetStaticProperties, setLocationId, setParentExpression, setParentExpression, suppressValidation`

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DocumentSorter

    public DocumentSorter(Expression base)

Method Detail

### getComparer

    public NodeOrderComparer getComparer()

### simplify

    public Expression simplify(StaticContext env)
                        throws XPathException

  Description copied from class: `UnaryExpression`
  Simplify an expression

  Overrides:
    `simplify` in class `UnaryExpression`
  Returns:
    the simplified expression
  Throws:
    `XPathException` - if an error is discovered during expression rewriting

### optimize

    public Expression optimize(Optimizer opt,
                               StaticContext env,
                               ItemType contextItemType)
                        throws XPathException

  Description copied from class: `UnaryExpression`
  Perform optimisation of an expression and its subexpressions.

  This method is called after all references to functions and variables have been resolved to the declaration of the function or variable, and after all type checking has been done.

  Overrides:
    `optimize` in class `UnaryExpression`
  Parameters:
    `opt` - the optimizer in use. This provides access to supporting functions; it also allows different optimization strategies to be used in different circumstances.
    `env` - the static context of the expression
    `contextItemType` - the static type of "." at the point where this expression is invoked. The parameter is set to null if it is known statically that the context item will be undefined. If the type of the context item is not known statically, the argument is set to `Type.ITEM_TYPE`
  Returns:
    the original expression, rewritten if appropriate to optimize execution
  Throws:
    `StaticError` - if an error is discovered during this phase (typically a type error)
    `XPathException`

### computeSpecialProperties

    public int computeSpecialProperties()

  Description copied from class: `UnaryExpression`
  Get the static properties of this expression (other than its type). The result is bit-signficant. These properties are used for optimizations. In general, if property bit is set, it is true, but if it is unset, the value is unknown.

  Overrides:
    `computeSpecialProperties` in class `UnaryExpression`

### promote

    public Expression promote(PromotionOffer offer)
                       throws XPathException

  Promote this expression if possible

  Overrides:
    `promote` in class `UnaryExpression`
  Parameters:
    `offer` - details of the offer, for example the offer to move expressions that don't depend on the context to an outer level in the containing expression
  Returns:
    if the offer is not accepted, return this expression unchanged. Otherwise return the result of rewriting the expression to promote this subexpression
  Throws:
    `XPathException` - if any error is detected

### iterate

    public SequenceIterator iterate(XPathContext context)
                             throws XPathException

  Description copied from class: `Expression`
  Return an Iterator to iterate over the values of a sequence. The value of every expression can be regarded as a sequence, so this method is supported for all expressions. This default implementation handles iteration for expressions that return singleton values: for non-singleton expressions, the subclass must provide its own implementation.

  Specified by:
    `iterate` in interface `SequenceIterable`
  Overrides:
    `iterate` in class `Expression`
  Parameters:
    `context` - supplies the context for evaluation
  Returns:
    a SequenceIterator that can be used to iterate over the result of the expression
  Throws:
    `XPathException` - if any dynamic error occurs evaluating the expression

### effectiveBooleanValue

    public boolean effectiveBooleanValue(XPathContext context)
                                  throws XPathException

  Description copied from class: `Expression`
  Get the effective boolean value of the expression. This returns false if the value is the empty sequence, a zero-length string, a number equal to zero, or the boolean false. Otherwise it returns true.

  Overrides:
    `effectiveBooleanValue` in class `Expression`
  Parameters:
    `context` - The context in which the expression is to be evaluated
  Returns:
    the effective boolean value
  Throws:
    `XPathException` - if any dynamic error occurs evaluating the expression

Overview | Package | Class | Deprecated | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (C) Michael H. Kay. All rights reserved.