001package gudusoft.gsqlparser.nodes;
002
003import gudusoft.gsqlparser.ESqlClause;
004import gudusoft.gsqlparser.TCustomSqlStatement;
005
006/**
007 * @deprecated As of v1.8.6.3, replaced by {@link TWindowDef}
008 *
009 * Window/analytic clause of Window (or analytic) functions.
010 * <p>
011 * partitioning ::= PARTITION BY value[, value...], call method {@link #getPartitionBy_ExprList()}
012 * to get list of values.
013 *
014 * <p>
015 * ordering ::= ORDER [SIBLINGS] BY rule[, rule...], call method {@link #getOrderBy()}
016 * to get order clause.
017 *
018*/
019public class TAnalyticFunction extends TParseTreeNode {
020
021    public void setWindow_aggregation_group_clause(TDummy window_aggregation_group_clause) {
022        this.window_aggregation_group_clause = window_aggregation_group_clause;
023    }
024
025    public TDummy getWindow_aggregation_group_clause() {
026
027        return window_aggregation_group_clause;
028    }
029
030    private TDummy window_aggregation_group_clause = null;
031    private boolean overClause = false;
032    private boolean withinGroup = false;
033
034    public void setOverClause(boolean overClause) {
035        this.overClause = overClause;
036    }
037
038    public void setWithinGroup(boolean withinGroup) {
039        this.withinGroup = withinGroup;
040    }
041
042    public boolean isOverClause() {
043
044        return overClause;
045    }
046
047    public boolean isWithinGroup() {
048        return withinGroup;
049    }
050
051    private TKeepDenseRankClause keepDenseRankClause = null;
052    private TExpressionList partitionBy_ExprList = null;
053    private TOrderBy orderBy = null;
054
055    public void setWithinGroupOrderBy(TOrderBy withinGroupOrderBy) {
056        this.withinGroupOrderBy = withinGroupOrderBy;
057    }
058
059    public TOrderBy getWithinGroupOrderBy() {
060
061        return withinGroupOrderBy;
062    }
063
064    private TOrderBy withinGroupOrderBy = null;
065
066    public void setOrderBy(TOrderBy orderBy) {
067        this.orderBy = orderBy;
068    }
069
070    public void setPartitionBy_ExprList(TExpressionList partitionBy_ExprList) {
071        this.partitionBy_ExprList = partitionBy_ExprList;
072    }
073
074    public void setKeepDenseRankClause(TKeepDenseRankClause keepDenseRankClause) {
075        this.keepDenseRankClause = keepDenseRankClause;
076    }
077
078    public TKeepDenseRankClause getKeepDenseRankClause() {
079        return keepDenseRankClause;
080    }
081
082    /**
083     * ordering ::= ORDER [SIBLINGS] BY rule[, rule...]
084     * @return a value of order by clause.
085     */
086    public TOrderBy getOrderBy() {
087        return orderBy;
088    }
089
090    /**
091     * partitioning ::= PARTITION BY value[, value...]
092     * @return a list of values.
093     */
094    public TExpressionList getPartitionBy_ExprList() {
095        return partitionBy_ExprList;
096    }
097
098    private TWindowFrame windowFrame;
099
100    public void setWindowFrame(TWindowFrame windowFrame) {
101
102        this.windowFrame = windowFrame;
103    }
104
105    public TWindowFrame getWindowFrame() {
106
107        return windowFrame;
108    }
109
110    public void doParse(TCustomSqlStatement psql, ESqlClause plocation){
111        if (keepDenseRankClause != null){
112            keepDenseRankClause.doParse(psql,plocation);
113        }
114        
115        if (orderBy != null){
116
117            orderBy.doParse(psql,plocation);
118        }
119
120        if (partitionBy_ExprList != null){
121            partitionBy_ExprList.doParse(psql,plocation);
122        }
123    }
124
125    public void accept(TParseTreeVisitor v){
126        v.preVisit(this);
127        v.postVisit(this);
128    }
129
130    public void acceptChildren(TParseTreeVisitor v){
131        v.preVisit(this);
132        if (keepDenseRankClause != null){
133            keepDenseRankClause.acceptChildren(v);
134        }
135
136        if (orderBy != null){
137
138            orderBy.acceptChildren(v);
139        }
140
141        if (partitionBy_ExprList != null){
142            partitionBy_ExprList.acceptChildren(v);
143        }
144        v.postVisit(this);
145    }
146
147
148}