Package org.basex.query.func.fn
Class FnSort
-
public final class FnSort extends StandardFunc
Function implementation.- Author:
- BaseX Team 2005-23, BSD License, Christian Gruen
-
-
Field Summary
-
Fields inherited from class org.basex.query.func.StandardFunc
definition, sc
-
-
Constructor Summary
Constructors Constructor Description FnSort()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
has(Flag... flags)
Indicates if an expression has one of the specified compiler properties.Iter
iter(QueryContext qc)
Evaluates the expression and returns an iterator on the resulting items.protected Expr
opt(CompileContext cc)
Performs function specific optimizations.Expr
simplifyFor(CompileContext.Simplify mode, CompileContext cc)
Simplifies the expression.static Integer[]
sort(ValueList values, StandardFunc sf, Collation coll, QueryContext qc)
Sort the input data and returns integers representing the item order.Value
value(QueryContext qc)
Evaluates the expression and returns the resulting value.-
Methods inherited from class org.basex.query.func.StandardFunc
checkPerm, coerceFunc, compileData, copy, dataLock, defined, description, embed, equals, optFirst, optFirst, optimize, serialize, simplifyArgs, toBaseUri, toBindings, toCollation, toCollationOrDefault, toContent, toContent, toData, toDate, toDBNode, toEncodingOrNull, toFunction, toFunction, toIO, toIO, toMs, toName, toNodeOrAtomItem, toOptions, toOptions, toPath, toPath, toStr, toString, toXml, toZeroStr, updating, vacuous
-
Methods inherited from class org.basex.query.expr.Arr
accept, allAreValues, arg, args, checkUp, compile, copyAll, count, exprSize, flatten, inline, inlineable, mayBePositional, removeEmpty, simplifyAll
-
Methods inherited from class org.basex.query.expr.ParseExpr
adoptType, atomValue, checkAllUp, checkNoEmpty, checkNoEmpty, checkNoneUp, checkNoUp, checkType, checkType, checkUp, copyType, ctxValue, data, ebv, info, item, refineType, seqType, size, test, toArray, toArray, toAtomItem, toB64, toB64, toB64OrNull, toBin, toBin, toBoolean, toBoolean, toBooleanOrFalse, toBytes, toBytes, toDouble, toDouble, toElem, toElem, toFloat, toFunction, toItem, toItem, toLong, toLong, toMap, toMap, toNode, toNode, toNodeOrNull, toNumber, toNumberOrNull, toQNm, toQNmOrNull, toString, toString, toStringOrNull, toToken, toToken, toTokenOrNull, toZeroToken
-
Methods inherited from class org.basex.query.expr.Expr
arg, atomItem, atomIter, ddo, funcType, hasFreeVars, indexAccessible, isSimple, markTailCalls, mergeEbv, optimizePos, simplify, typeCheck, uses, visitAll
-
Methods inherited from class org.basex.query.expr.ExprInfo
toErrorString, toString
-
-
-
-
Method Detail
-
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 classParseExpr
- 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 classParseExpr
- 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
- values to sortsf
- calling functioncoll
- collationqc
- query context- Returns:
- item order
- Throws:
QueryException
- query exception
-
simplifyFor
public Expr simplifyFor(CompileContext.Simplify mode, CompileContext cc) throws QueryException
Description copied from class:Expr
Simplifies the expression. Overwritten by many expressions; callsExpr.simplify(Simplify, CompileContext)
otherwise.- Overrides:
simplifyFor
in classExpr
- Parameters:
mode
- mode of simplificationcc
- compilation context- Returns:
- simplified or original expression
- Throws:
QueryException
- query exception- See Also:
CompileContext.Simplify
-
opt
protected Expr opt(CompileContext cc) throws QueryException
Description copied from class:StandardFunc
Performs function specific optimizations.- Overrides:
opt
in classStandardFunc
- Parameters:
cc
- compilation context- Returns:
- optimized or original expression
- Throws:
QueryException
- query exception
-
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 returnstrue
if at least flag matches an expression.- Overrides:
has
in classStandardFunc
- Parameters:
flags
- flags to be checked- Returns:
- result of check
-
-