package com.alibaba.druid.sql.dialect.postgresql.ast.stmt.alterTable;

import com.alibaba.druid.sql.ast.SQLExpr;
import com.alibaba.druid.sql.ast.statement.SQLAlterTableItem;
import com.alibaba.druid.sql.dialect.postgresql.ast.PGSQLObject;
import com.alibaba.druid.sql.dialect.postgresql.ast.PGSQLObjectImpl;
import com.alibaba.druid.sql.dialect.postgresql.visitor.PGASTVisitor;
import com.alibaba.druid.sql.visitor.SQLASTVisitor;

public class PGAlterTableCluster extends PGSQLObjectImpl implements SQLAlterTableItem, PGSQLObject {
   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((PGASTVisitor)visitor);
   }

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

      visitor.endVisit(this);
   }

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

   public static enum Type {
      all,
      user;
   }
}
