package com.chenyang.druid.sql.dialect.greenplum.ast.stmt.alterTable;

import com.chenyang.druid.sql.ast.SQLExpr;
import com.chenyang.druid.sql.ast.statement.SQLAlterTableItem;
import com.chenyang.druid.sql.dialect.greenplum.ast.GPSQLObject;
import com.chenyang.druid.sql.dialect.greenplum.ast.GPSQLObjectImpl;
import com.chenyang.druid.sql.dialect.greenplum.visitor.GPASTVisitor;
import com.chenyang.druid.sql.visitor.SQLASTVisitor;

public class GPAlterTableCluster extends GPSQLObjectImpl implements SQLAlterTableItem, GPSQLObject {
   private SQLExpr index;

   public SQLExpr getIndex() {
      return this.index;
   }

   public void setIndex(SQLExpr index) {
      this.index = index;
      index.setParent(this);
   }

   public void accept0(SQLASTVisitor visitor) {
      this.accept0((GPASTVisitor)visitor);
   }

   public void accept0(GPASTVisitor visitor) {
      if (visitor.visit(this)) {
         this.index.accept(visitor);
      }

      visitor.endVisit(this);
   }

   public GPAlterTableCluster clone() {
      GPAlterTableCluster c = new GPAlterTableCluster();
      c.setIndex(this.index.clone());
      return c;
   }

   public static enum Type {
      all,
      user;
   }
}
