public class WindowClause extends Clause
Modifier and Type | Class and Description |
---|---|
protected static class |
WindowClause.Window
Information about a window: the items making up the window, as well as the variables relating to the
start and end of the window, and the status of the winoow in relation to the processing of the current
input sequence.
|
Modifier and Type | Field and Description |
---|---|
static int |
END_ITEM |
static int |
END_ITEM_POSITION |
static int |
END_NEXT_ITEM |
static int |
END_PREVIOUS_ITEM |
static int |
START_ITEM |
static int |
START_ITEM_POSITION |
static int |
START_NEXT_ITEM |
static int |
START_PREVIOUS_ITEM |
static int |
WINDOW_VAR |
COUNT, FOR, GROUPBYCLAUSE, LET, ORDERBYCLAUSE, TRACE, WHERE, WINDOW
Constructor and Description |
---|
WindowClause() |
Modifier and Type | Method and Description |
---|---|
void |
addToPathMap(PathMap pathMap,
PathMap.PathMapNodeSet pathMapNodeSet)
Collect information about the navigation paths followed by this clause, for document projection purposes
|
Clause |
copy(FLWORExpression flwor,
RebindingMap rebindings)
Create a copy of this clause
|
void |
explain(ExpressionPresenter out)
Diagnostic print of expression structure.
|
int |
getClauseKey()
Get a keyword identifying what kind of clause this is
|
Expression |
getEndCondition() |
TuplePull |
getPullStream(TuplePull base,
XPathContext context)
Get a pull-mode tuple stream that implements the functionality of this clause, taking its
input from another tuple stream which this clause modifies
|
TuplePush |
getPushStream(TuplePush destination,
XPathContext context)
Get a push-mode tuple stream that implements the functionality of this clause, supplying its
output to another tuple stream
|
LocalVariableBinding[] |
getRangeVariables()
Get the variables bound by this clause
|
Expression |
getSequence() |
Expression |
getStartCondition() |
LocalVariableBinding |
getVariableBinding(int role) |
void |
initEndCondition(FLWORExpression flwor,
Expression endCondition) |
void |
initSequence(FLWORExpression flwor,
Expression sequence) |
void |
initStartCondition(FLWORExpression flwor,
Expression startCondition) |
boolean |
isIncludeUnclosedWindows() |
boolean |
isSlidingWindow() |
boolean |
isTumblingWindow() |
protected static Sequence |
makeValue(Item item) |
protected boolean |
matchesEnd(WindowClause.Window window,
Item previous,
Item current,
Item next,
int position,
XPathContext context)
Determine whether the current item is the last item in a window
|
protected boolean |
matchesStart(Item previous,
Item current,
Item next,
int position,
XPathContext context)
Determine whether the current item is the start of a new window
|
void |
processOperands(OperandProcessor processor)
Process the subexpressions of this clause
|
void |
setEndCondition(Expression endCondition) |
void |
setIncludeUnclosedWindows(boolean include) |
void |
setIsSlidingWindow(boolean sliding) |
void |
setSequence(Expression sequence) |
void |
setStartCondition(Expression startCondition) |
void |
setVariableBinding(int role,
LocalVariableBinding binding) |
containsNonInlineableVariableReference, gatherVariableReferences, getConfiguration, getLocation, getPackageData, isRepeated, optimize, refineVariableType, setLocation, setPackageData, setRepeated, toShortString, typeCheck
public static final int WINDOW_VAR
public static final int START_ITEM
public static final int START_ITEM_POSITION
public static final int START_PREVIOUS_ITEM
public static final int START_NEXT_ITEM
public static final int END_ITEM
public static final int END_ITEM_POSITION
public static final int END_PREVIOUS_ITEM
public static final int END_NEXT_ITEM
public int getClauseKey()
Clause
getClauseKey
in class Clause
public void setIsSlidingWindow(boolean sliding)
public boolean isSlidingWindow()
public boolean isTumblingWindow()
public void setIncludeUnclosedWindows(boolean include)
public boolean isIncludeUnclosedWindows()
public void initSequence(FLWORExpression flwor, Expression sequence)
public void setSequence(Expression sequence)
public Expression getSequence()
public void initStartCondition(FLWORExpression flwor, Expression startCondition)
public void setStartCondition(Expression startCondition)
public Expression getStartCondition()
public void initEndCondition(FLWORExpression flwor, Expression endCondition)
public void setEndCondition(Expression endCondition)
public Expression getEndCondition()
public void setVariableBinding(int role, LocalVariableBinding binding) throws XPathException
XPathException
public LocalVariableBinding getVariableBinding(int role)
public Clause copy(FLWORExpression flwor, RebindingMap rebindings)
Clause
public TuplePull getPullStream(TuplePull base, XPathContext context)
getPullStream
in class Clause
base
- the input tuple streamcontext
- the dynamic evaluation contextpublic TuplePush getPushStream(TuplePush destination, XPathContext context)
getPushStream
in class Clause
destination
- the output tuple streamcontext
- the dynamic evaluation contextpublic void processOperands(OperandProcessor processor) throws XPathException
processOperands
in class Clause
processor
- the expression processor used to process the subexpressionsXPathException
- if any error is detectedpublic void addToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodeSet)
Clause
addToPathMap
in class Clause
pathMap
- the path map in which the data is to be collectedpathMapNodeSet
- the path map node set representing the paths to the context itempublic LocalVariableBinding[] getRangeVariables()
getRangeVariables
in class Clause
public void explain(ExpressionPresenter out) throws XPathException
explain
in class Clause
out
- the expression presenter used to display the structureXPathException
protected boolean matchesStart(Item previous, Item current, Item next, int position, XPathContext context) throws XPathException
previous
- the item before the current item (null if the current item is the first)current
- the current itemnext
- the item after the current item (null if the current item is the last)position
- the position of the current item in the input sequencecontext
- the dynamic evaluation contextXPathException
protected boolean matchesEnd(WindowClause.Window window, Item previous, Item current, Item next, int position, XPathContext context) throws XPathException
window
- the window in questionprevious
- the item before the current item (null if the current item is the first)current
- the current itemnext
- the item after the current item (null if the current item is the last)position
- the position of the current item in the input sequencecontext
- the dynamic evaluation contextXPathException
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.