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

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

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

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

      visitor.endVisit(this);
   }

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