|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.expr.sort.SortKeyDefinition
public class SortKeyDefinition
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.
Field Summary | |
---|---|
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
|
Constructor Summary | |
---|---|
SortKeyDefinition()
|
Method Summary | |
---|---|
SortKeyDefinition |
copy()
Copy this SortKeyDefinition |
boolean |
equals(Object other)
Compare two SortKeyDefinition values for equality. |
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. |
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. |
void |
processSubExpressions(ExpressionProcessor processor)
Process the subexpressions of this clause |
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(ExpressionVisitor visitor)
Simplify this sort key definition |
void |
typeCheck(ExpressionVisitor visitor,
ExpressionVisitor.ContextItemType contextItemType)
Type-check this sort key definition (all properties other than the sort key select expression, when it has a different dynamic context) |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public SortKeyDefinition()
Method Detail |
---|
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(ExpressionVisitor visitor) throws XPathException
visitor
- the expression visitor
XPathException
- if any failure occurspublic SortKeyDefinition copy()
public void typeCheck(ExpressionVisitor visitor, ExpressionVisitor.ContextItemType contextItemType) throws XPathException
visitor
- the expression visitorcontextItemType
- the type of the context item
XPathException
- if any failure occurspublic void processSubExpressions(ExpressionProcessor processor) throws XPathException
processor
- the expression processor used to process the subexpressions
XPathException
public AtomicComparer makeComparator(XPathContext context) throws XPathException
context
- the dynamic evaluation context
XPathException
public 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)
equals
in class Object
other
- SortKeyDefinition
public int hashCode()
hashCode
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |