Package net.sf.saxon.sort
Class SortKeyDefinition
java.lang.Object
net.sf.saxon.sort.SortKeyDefinition
- All Implemented Interfaces:
Serializable
A SortKeyDefinition defines one component of a sort key.
Note that most attributes defining the sort key can be attribute value templates, and can therefore vary from one invocation to another. We hold them as expressions. As soon as they are all known (which in general is only at run-time), the SortKeyDefinition is replaced by a FixedSortKeyDefinition in which all these values are fixed.
Note that most attributes defining the sort key can be attribute value templates, and can therefore vary from one invocation to another. We hold them as expressions. As soon as they are all known (which in general is only at run-time), the SortKeyDefinition is replaced by a FixedSortKeyDefinition in which all these values are fixed.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected String
protected Expression
protected Comparator
protected Expression
protected Comparator
protected Expression
protected boolean
protected Expression
protected Expression
protected Container
protected Expression
protected Expression
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the comparer which is used to compare two values according to this sort key.boolean
getOrder()
Get the expression used as the sort keyboolean
boolean
isFixed()
Determine whether the sort key definition is fixed, that is, whether all the information needed to create a Comparator is known staticallymakeComparator
(XPathContext context) Allocate a Comparator to perform the comparisons described by this sort key componentvoid
setBackwardsCompatible
(boolean compatible) void
setBaseURI
(String baseURI) void
setCaseOrder
(Expression exp) Set the case order.void
setCollation
(Comparator collation) void
setCollationName
(Expression collationName) Set the collation.void
setComparer
(Comparator comp) Set the comparer which is used to compare two values according to this sort key.void
Set the data type.void
setEmptyLeast
(boolean emptyLeast) Set whether empty sequence comes before other values or after themvoid
setLanguage
(Expression exp) Set the language.void
setOrder
(Expression exp) Set the order.void
setParentExpression
(Container container) void
setSortKey
(Expression exp) Set the expression used as the sort keyvoid
setStable
(Expression stable) simplify
(StaticContext env, Executable exec)
-
Field Details
-
sortKey
-
order
-
dataTypeExpression
-
caseOrder
-
language
-
collationName
-
stable
-
collation
-
baseURI
-
emptyLeast
protected boolean emptyLeast -
backwardsCompatible
protected boolean backwardsCompatible -
parentExpression
-
comparer
-
-
Constructor Details
-
SortKeyDefinition
public SortKeyDefinition()
-
-
Method Details
-
setParentExpression
-
getParentExpression
-
setSortKey
Set the expression used as the sort key -
getSortKey
Get the expression used as the sort key -
setOrder
Set the order. This is supplied as an expression which must evaluate to "ascending" or "descending". If the order is fixed, supply e.g. new StringValue("ascending"). Default is "ascending". -
getOrder
-
setDataTypeExpression
Set the data type. This is supplied as an expression which must evaluate to "text", "number", or a QName. If the data type is fixed, the valus should be supplied using setDataType() and not via this method. -
getDataTypeExpression
-
setCaseOrder
Set the case order. This is supplied as an expression which must evaluate to "upper-first" or "lower-first" or "#default". If the order is fixed, supply e.g. new StringValue("lower-first"). Default is "#default". -
getCaseOrder
-
setLanguage
Set the language. This is supplied as an expression which evaluates to the language name. If the order is fixed, supply e.g. new StringValue("de"). -
getLanguage
-
setCollationName
Set the collation. -
getCollationName
-
setCollation
-
getCollation
-
setBaseURI
-
getBaseURI
-
setStable
-
getStable
-
setBackwardsCompatible
public void setBackwardsCompatible(boolean compatible) -
isBackwardsCompatible
public boolean isBackwardsCompatible() -
setEmptyLeast
public void setEmptyLeast(boolean emptyLeast) Set whether empty sequence comes before other values or after them- Parameters:
emptyLeast
- true if () is considered lower than any other value
-
getEmptyLeast
public boolean getEmptyLeast() -
isFixed
public boolean isFixed()Determine whether the sort key definition is fixed, that is, whether all the information needed to create a Comparator is known statically -
simplify
- Throws:
XPathException
-
makeComparator
Allocate a Comparator to perform the comparisons described by this sort key component- Throws:
XPathException
-
setComparer
Set the comparer which is used to compare two values according to this sort key. -
getComparer
Get the comparer which is used to compare two values according to this sort key.
-