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 |
---|---|
Clause |
copy()
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) |
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 |
processSubExpressions(ExpressionProcessor 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, getLocationId, optimize, refineVariableType, setLocationId, 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 setSequence(Expression sequence)
public Expression getSequence()
public void setStartCondition(Expression startCondition)
public Expression getStartCondition()
public void setEndCondition(Expression endCondition)
public Expression getEndCondition()
public void setVariableBinding(int role, LocalVariableBinding binding) throws XPathException
XPathException
public LocalVariableBinding getVariableBinding(int role)
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 processSubExpressions(ExpressionProcessor processor) throws XPathException
processSubExpressions
in class Clause
processor
- the expression processor used to process the subexpressionsXPathException
- if any error is detectedpublic LocalVariableBinding[] getRangeVariables()
getRangeVariables
in class Clause
public void explain(ExpressionPresenter out)
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-2013 Saxonica Limited. All rights reserved.