package com.chenyang.druid.sql.dialect.dm.ast.stmt;

import com.chenyang.druid.sql.ast.statement.SQLColumnConstraint;
import com.chenyang.druid.sql.ast.statement.SQLConstraintImpl;
import com.chenyang.druid.sql.dialect.dm.ast.DMSQLObject;
import com.chenyang.druid.sql.dialect.dm.visitor.DmASTVisitor;
import com.chenyang.druid.sql.visitor.SQLASTOutputVisitor;
import com.chenyang.druid.sql.visitor.SQLASTVisitor;

public class DmSQLColumnPrimaryKey extends SQLConstraintImpl implements SQLColumnConstraint, DMSQLObject {
   boolean cluster;
   boolean primary;
   boolean not;
   boolean unique;
   boolean key;

   protected void accept0(SQLASTVisitor v) {
      if (v instanceof DmASTVisitor) {
         this.accept0((DmASTVisitor)v);
      } else {
         if (v instanceof SQLASTOutputVisitor) {
            ((SQLASTOutputVisitor)v).print(this.toString());
         }

      }
   }

   public void accept0(DmASTVisitor visitor) {
      if (visitor.visit(this)) {
         this.acceptChild(visitor, this.getName());
      }

      visitor.endVisit(this);
   }

   public DmSQLColumnPrimaryKey clone() {
      DmSQLColumnPrimaryKey x = new DmSQLColumnPrimaryKey();
      super.cloneTo((SQLConstraintImpl)x);
      return x;
   }

   public boolean isCluster() {
      return this.cluster;
   }

   public void setCluster(boolean cluster) {
      this.cluster = cluster;
   }

   public boolean isNot() {
      return this.not;
   }

   public void setNot(boolean not) {
      this.not = not;
   }

   public boolean isUnique() {
      return this.unique;
   }

   public void setUnique(boolean unique) {
      this.unique = unique;
   }

   public boolean isKey() {
      return this.key;
   }

   public void setKey(boolean key) {
      this.key = key;
   }

   public boolean isPrimary() {
      return this.primary;
   }

   public void setPrimary(boolean primary) {
      this.primary = primary;
   }
}
