package com.alibaba.druid.sql.dialect.mariadb.ast.statement;

import com.alibaba.druid.sql.ast.statement.SQLExprTableSource;
import com.alibaba.druid.sql.dialect.mariadb.visitor.MariadbASTVisitor;
import java.util.ArrayList;
import java.util.List;

public class MariadbOptimizeStatement extends MariadbStatementImpl {
   private boolean noWriteToBinlog = false;
   private boolean local = false;
   protected final List<SQLExprTableSource> tableSources = new ArrayList();

   public void accept0(MariadbASTVisitor visitor) {
      if (visitor.visit(this)) {
         this.acceptChild(visitor, this.tableSources);
      }

      visitor.endVisit(this);
   }

   public boolean isNoWriteToBinlog() {
      return this.noWriteToBinlog;
   }

   public void setNoWriteToBinlog(boolean noWriteToBinlog) {
      this.noWriteToBinlog = noWriteToBinlog;
   }

   public boolean isLocal() {
      return this.local;
   }

   public void setLocal(boolean local) {
      this.local = local;
   }

   public List<SQLExprTableSource> getTableSources() {
      return this.tableSources;
   }

   public void addTableSource(SQLExprTableSource tableSource) {
      if (tableSource != null) {
         tableSource.setParent(this);
      }

      this.tableSources.add(tableSource);
   }
}
