Package org.h2.expression.analysis
Class WindowFrameBound
- java.lang.Object
-
- org.h2.expression.analysis.WindowFrameBound
-
public class WindowFrameBound extends java.lang.Object
Window frame bound.
-
-
Field Summary
Fields Modifier and Type Field Description private int
expressionIndex
private boolean
isVariable
private WindowFrameBoundType
type
private Expression
value
-
Constructor Summary
Constructors Constructor Description WindowFrameBound(WindowFrameBoundType type, Expression value)
Creates new instance of window frame bound.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getExpressionIndex()
Returns the index of preserved expression.java.lang.StringBuilder
getSQL(java.lang.StringBuilder builder, boolean following, int sqlFlags)
Appends SQL representation to the specified builder.WindowFrameBoundType
getType()
Returns the typeExpression
getValue()
Returns the value.boolean
isParameterized()
Returns whether bound is defined as n PRECEDING or n FOLLOWING.boolean
isVariable()
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 Detail
-
type
private final WindowFrameBoundType type
-
value
private Expression value
-
isVariable
private boolean isVariable
-
expressionIndex
private int expressionIndex
-
-
Constructor Detail
-
WindowFrameBound
public WindowFrameBound(WindowFrameBoundType type, Expression value)
Creates new instance of window frame bound.- Parameters:
type
- bound typevalue
- bound value, if any
-
-
Method Detail
-
getType
public WindowFrameBoundType getType()
Returns the type- Returns:
- the type
-
getValue
public Expression 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
void mapColumns(ColumnResolver resolver, int level, int state)
Map the columns of the resolver to expression columns.- Parameters:
resolver
- the column resolverlevel
- the subquery nesting levelstate
- current state for nesting checks
-
optimize
void optimize(SessionLocal session)
Try to optimize bound expression.- Parameters:
session
- the session
-
updateAggregate
void updateAggregate(SessionLocal session, int stage)
Update an aggregate value.- Parameters:
session
- the sessionstage
- select stage- See Also:
Expression.updateAggregate(SessionLocal, int)
-
getSQL
public java.lang.StringBuilder getSQL(java.lang.StringBuilder builder, boolean following, int sqlFlags)
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:
Expression.getSQL(StringBuilder, int, int)
-
-