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

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

public class GPAlterTableInheriteOrNotParentTable extends GPSQLObjectImpl implements SQLAlterTableItem, GPSQLObject {
   private boolean inherite = false;
   private SQLExpr parentTable;

   public boolean isInherite() {
      return this.inherite;
   }

   public void setInherite(boolean inherite) {
      this.inherite = inherite;
   }

   public SQLExpr getParentTable() {
      return this.parentTable;
   }

   public void setParentTable(SQLExpr parentTable) {
      this.parentTable = parentTable;
      parentTable.setParent(this);
   }

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

   public void accept0(GPASTVisitor visitor) {
      if (visitor.visit(this)) {
         this.acceptChild(visitor, this.parentTable);
      }

      visitor.endVisit(this);
   }

   public GPAlterTableInheriteOrNotParentTable clone() {
      GPAlterTableInheriteOrNotParentTable c = new GPAlterTableInheriteOrNotParentTable();
      c.setParentTable(this.parentTable.clone());
      c.inherite = this.inherite;
      return c;
   }
}
