public class SortKeyDefinition extends PseudoExpression
Modifier and Type | Field and Description |
---|---|
protected boolean |
backwardsCompatible |
protected String |
baseURI |
protected Expression |
caseOrder |
protected StringCollator |
collation |
protected Expression |
collationName |
protected Expression |
dataTypeExpression |
protected boolean |
emptyLeast |
protected Expression |
language |
protected Expression |
order |
protected boolean |
setContextForSortKey |
protected Expression |
sortKey |
protected Expression |
stable |
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, WATCH_METHOD
Constructor and Description |
---|
SortKeyDefinition() |
Modifier and Type | Method and Description |
---|---|
SortKeyDefinition |
copy()
Copy this SortKeyDefinition
|
boolean |
equals(Object other)
Compare two SortKeyDefinition values for equality.
|
void |
export(ExpressionPresenter out)
Diagnostic print of expression structure.
|
SortKeyDefinition |
fix(XPathContext context) |
String |
getBaseURI()
Get the static base URI of the expression.
|
Expression |
getCaseOrder()
Get the expression that defines the case order of the sort keys.
|
StringCollator |
getCollation()
Get the collation to be used
|
Expression |
getCollationNameExpression()
Get the selected collation name
(specifically, an expression which when evaluated returns the collation URI).
|
Expression |
getDataTypeExpression()
Get the expression that defines the data type of the sort keys
|
boolean |
getEmptyLeast()
Ask whether empty sequence comes before other values or after them
|
AtomicComparer |
getFinalComparator()
Get the comparator which is used to compare two values according to this sort key.
|
int |
getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
|
Expression |
getLanguage()
Get the expression that defines the language of the sort keys
|
Expression |
getOrder()
Get the expression that defines the order as ascending or descending
|
Expression |
getSortKey()
Get the expression used as the sort key
|
Expression |
getStable()
Ask whether this sort key definition is stable
|
int |
hashCode()
Get a hashcode to reflect the equals() method
|
boolean |
isBackwardsCompatible()
Ask whether this sort key is evaluated in XSLT 1.0 backwards compatibility mode
|
boolean |
isFixed()
Ask whether the sort key definition is fixed, that is, whether all the information needed
to create a Comparator is known statically
|
boolean |
isSetContextForSortKey()
Ask whether the sortkey is to be evaluated with the item-being-sorted
as the context item
|
AtomicComparer |
makeComparator(XPathContext context)
Allocate an AtomicComparer to perform the comparisons described by this sort key component.
|
Iterable<Operand> |
operands()
Get the immediate sub-expressions of this expression, with information about the relationship
of each expression to its parent expression.
|
void |
setBackwardsCompatible(boolean compatible)
Set whether this sort key is evaluated in XSLT 1.0 backwards compatibility mode
|
void |
setBaseURI(String baseURI)
Set the base URI of the expression.
|
void |
setCaseOrder(Expression exp)
Set the case order.
|
void |
setCollation(StringCollator collation)
Set the collation to be used
|
void |
setCollationNameExpression(Expression collationName)
Set the collation name (specifically, an expression which when evaluated returns the collation URI).
|
void |
setDataTypeExpression(Expression exp)
Set the data type.
|
void |
setEmptyLeast(boolean emptyLeast)
Set whether empty sequence comes before other values or after them
|
void |
setFinalComparator(AtomicComparer comp)
Set the comparator which is used to compare two values according to this sort key.
|
void |
setLanguage(Expression exp)
Set the language.
|
void |
setOrder(Expression exp)
Set the order.
|
void |
setSortKey(Expression exp,
boolean setContext)
Set the expression used as the sort key
|
void |
setStable(Expression stable)
Set whether this sort key definition is stable
|
SortKeyDefinition |
simplify()
Simplify this sort key definition
|
SortKeyDefinition |
typeCheck(ExpressionVisitor visitor,
ContextItemStaticInfo contextItemType)
Type-check this sort key definition (all properties other than the sort key
select expression, when it has a different dynamic context)
|
computeCardinality, effectiveBooleanValue, evaluateAsString, evaluateItem, getItemType, iterate, iterateEvents, process
addToPathMap, adoptChildExpression, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, clearStreamabilityData, computeDependencies, computeSpecialProperties, computeStaticProperties, doPromotion, dynamicError, evaluatePendingUpdates, explain, getCardinality, getConfiguration, getConstructType, getCost, getDependencies, getEvaluationMethod, getExpressionCompiler, getExpressionName, getHostLanguage, getIntegerBounds, getIntrinsicDependencies, getLocation, getNetCost, getObjectName, getPackageData, getParentExpression, getPosture, getPostureAndSweepIfKnown, getProperties, getProperty, getRetainedStaticContext, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStreamability, getStreamingAdjunct, getSweep, getSystemId, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isCallOnSystemFunction, isIdentical, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, makeStreamingAdjunct, markTailFunctionCalls, operandList, operandSparseList, optimize, optimizeChildren, optimizeForType, promote, promoteChildren, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setFiltered, setFlattened, setLocation, setParentExpression, setPostureAndSweep, setRetainedStaticContext, setRetainedStaticContextLocally, setStaticProperty, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, toShortString, toStreamingPattern, toString, typeCheckChildren, typeError, unordered
protected Expression sortKey
protected Expression order
protected Expression dataTypeExpression
protected Expression caseOrder
protected Expression language
protected Expression collationName
protected Expression stable
protected StringCollator collation
protected String baseURI
protected boolean emptyLeast
protected boolean backwardsCompatible
protected boolean setContextForSortKey
public void setSortKey(Expression exp, boolean setContext)
exp
- the sort key select expressionsetContext
- set to true if the sort key is to be evaluated with the
item-being-sorted as the context item (as in XSLT); false if the context item
is not to be set (as in XQuery)public Expression getSortKey()
public boolean isSetContextForSortKey()
public void setOrder(Expression exp)
exp
- the expression that determines the order (always a literal in XQuery, but
can be defined by an AVT in XSLT)public Expression getOrder()
public void setDataTypeExpression(Expression exp)
exp
- the expression that defines the data type, as used in XSLT 1.0public Expression getDataTypeExpression()
public void setCaseOrder(Expression exp)
exp
- the expression that defines the case orderpublic Expression getCaseOrder()
public void setLanguage(Expression exp)
exp
- the expression that determines the languagepublic Expression getLanguage()
public void setCollationNameExpression(Expression collationName)
collationName
- the expression that determines the collation namepublic Expression getCollationNameExpression()
public void setCollation(StringCollator collation)
collation
- A StringCollator, which encapsulates both the collation URI and the collating functionpublic StringCollator getCollation()
public void setBaseURI(String baseURI)
baseURI
- the static base URI of the expressionpublic String getBaseURI()
public void setStable(Expression stable)
stable
- the expression that determines whether the sort key definition is stable
(it evaluates to the string "yes" or "no".public Expression getStable()
public void setBackwardsCompatible(boolean compatible)
compatible
- true if backwards compatibility mode is selectedpublic boolean isBackwardsCompatible()
public void setEmptyLeast(boolean emptyLeast)
emptyLeast
- true if () is considered lower than any other valuepublic boolean getEmptyLeast()
public boolean isFixed()
public SortKeyDefinition simplify() throws XPathException
simplify
in class Expression
XPathException
- if any failure occurspublic SortKeyDefinition copy()
copy
in class Expression
public SortKeyDefinition typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextItemType) throws XPathException
typeCheck
in class Expression
visitor
- the expression visitorcontextItemType
- the type of the context itemXPathException
- if any failure occurspublic Iterable<Operand> operands()
Expression
If the expression is a Callable, then it is required that the order of the operands returned by this function is the same as the order of arguments supplied to the corresponding call() method.
operands
in class Expression
public int getImplementationMethod()
getImplementationMethod
in class PseudoExpression
Expression.ITERATE_METHOD
or Expression.EVALUATE_METHOD
or
Expression.PROCESS_METHOD
public AtomicComparer makeComparator(XPathContext context) throws XPathException
context
- the dynamic evaluation contextXPathException
- for example if the collation URI is invalid or unknownpublic void setFinalComparator(AtomicComparer comp)
This method is called at compile time if all these factors are known at compile time. It must not be called at run-time, except to reconstitute a finalComparator that has been lost by virtue of serialization .
comp
- the Atomic Comparer to be usedpublic AtomicComparer getFinalComparator()
makeComparator(net.sf.saxon.expr.XPathContext)
method.public SortKeyDefinition fix(XPathContext context) throws XPathException
XPathException
public boolean equals(Object other)
public int hashCode()
public void export(ExpressionPresenter out)
Expression
export
in class Expression
out
- the expression presenter used to display the structureCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.