Package org.h2.expression.analysis
Class WindowFrameBound
java.lang.Object
org.h2.expression.analysis.WindowFrameBound
Window frame bound.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private boolean
private final WindowFrameBoundType
private Expression
-
Constructor Summary
ConstructorsConstructorDescriptionWindowFrameBound
(WindowFrameBoundType type, Expression value) Creates new instance of window frame bound. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the index of preserved expression.getSQL
(StringBuilder builder, boolean following, int sqlFlags) Appends SQL representation to the specified builder.getType()
Returns the typegetValue()
Returns the value.boolean
Returns whether bound is defined as n PRECEDING or n FOLLOWING.boolean
Returns whether bound is defined with a variable.(package private) void
mapColumns
(ColumnResolver resolver, int level, int state) Map the columns of the resolver to expression columns.(package private) void
optimize
(SessionLocal session) Try to optimize bound expression.(package private) void
setExpressionIndex
(int expressionIndex) Sets the index of preserved expression.(package private) void
updateAggregate
(SessionLocal session, int stage) Update an aggregate value.
-
Field Details
-
type
-
value
-
isVariable
private boolean isVariable -
expressionIndex
private int expressionIndex
-
-
Constructor Details
-
WindowFrameBound
Creates new instance of window frame bound.- Parameters:
type
- bound typevalue
- bound value, if any
-
-
Method Details
-
getType
Returns the type- Returns:
- the type
-
getValue
Returns the value.- Returns:
- the value
-
isParameterized
public boolean isParameterized()Returns whether bound is defined as n PRECEDING or n FOLLOWING.- Returns:
- whether bound is defined as n PRECEDING or n FOLLOWING
-
isVariable
public boolean isVariable()Returns whether bound is defined with a variable. This method may be used only afteroptimize(SessionLocal)
invocation.- Returns:
- whether bound is defined with a variable
-
getExpressionIndex
public int getExpressionIndex()Returns the index of preserved expression.- Returns:
- the index of preserved expression, or -1
-
setExpressionIndex
void setExpressionIndex(int expressionIndex) Sets the index of preserved expression.- Parameters:
expressionIndex
- the index to set
-
mapColumns
Map the columns of the resolver to expression columns.- Parameters:
resolver
- the column resolverlevel
- the subquery nesting levelstate
- current state for nesting checks
-
optimize
Try to optimize bound expression.- Parameters:
session
- the session
-
updateAggregate
Update an aggregate value.- Parameters:
session
- the sessionstage
- select stage- See Also:
-
getSQL
Appends SQL representation to the specified builder.- Parameters:
builder
- string builderfollowing
- if false return SQL for starting clause, if true return SQL for following clausesqlFlags
- formatting flags- Returns:
- the specified string builder
- See Also:
-