Class FnSort


public final class FnSort extends StandardFunc
Function implementation.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Constructor Details

    • FnSort

      public FnSort()
  • Method Details

    • iter

      public Iter iter(QueryContext qc) throws QueryException
      Description copied from class: Expr
      Evaluates the expression and returns an iterator on the resulting items. The implementation of this method is optional.
      Overrides:
      iter in class ParseExpr
      Parameters:
      qc - query context
      Returns:
      iterator
      Throws:
      QueryException - query exception
    • value

      public Value value(QueryContext qc) throws QueryException
      Description copied from class: Expr
      Evaluates the expression and returns the resulting value. If this method is not implemented, Expr.item(QueryContext, InputInfo) must be implemented instead.
      Overrides:
      value in class ParseExpr
      Parameters:
      qc - query context
      Returns:
      value
      Throws:
      QueryException - query exception
    • sort

      public static Integer[] sort(ValueList values, StandardFunc sf, Collation coll, QueryContext qc) throws QueryException
      Sort the input data and returns integers representing the item order.
      Parameters:
      values - value list
      sf - calling function
      coll - collation
      qc - query context
      Returns:
      item order
      Throws:
      QueryException - query exception
    • opt

      protected Expr opt(CompileContext cc) throws QueryException
      Description copied from class: StandardFunc
      Performs function specific optimizations.
      Overrides:
      opt in class StandardFunc
      Parameters:
      cc - compilation context
      Returns:
      optimized or original expression
      Throws:
      QueryException - query exception
    • simplifyFor

      public Expr simplifyFor(CompileContext.Simplify mode, CompileContext cc) throws QueryException
      Description copied from class: Expr
      This function is called at compile time for expressions whose operands might be simplified.
      Overrides:
      simplifyFor in class Expr
      Parameters:
      mode - mode of simplification
      cc - compilation context
      Returns:
      simplified or original expression
      Throws:
      QueryException - query exception
      See Also:
    • has

      public boolean has(Flag... flags)
      Description copied from class: Expr
      Indicates if an expression has one of the specified compiler properties. This method must only be called at compile time. It is invoked to test properties of sub-expressions. It returns true if at least flag matches an expression.
      Overrides:
      has in class StandardFunc
      Parameters:
      flags - flags to be checked
      Returns:
      result of check