content: /* This file was generated by SableCC (http://www.sablecc.org/). */
  
  package com.abstratt.mdd.frontend.textuml.grammar.node;
  
  import com.abstratt.mdd.frontend.textuml.grammar.analysis.*;
  
  @SuppressWarnings("nls")
  public final class AElseifRestIf extends PRestIf
  {
      private TElseif _elseif_;
      private PIfClause _ifClause_;
      private PRestIf _restIf_;
  
      public AElseifRestIf()
      {
          // Constructor
      }
  
      public AElseifRestIf(
          @SuppressWarnings("hiding") TElseif _elseif_,
          @SuppressWarnings("hiding") PIfClause _ifClause_,
          @SuppressWarnings("hiding") PRestIf _restIf_)
      {
          // Constructor
          setElseif(_elseif_);
  
          setIfClause(_ifClause_);
  
          setRestIf(_restIf_);
  
      }
  
      @Override
      public Object clone()
      {
          return new AElseifRestIf(
              cloneNode(this._elseif_),
              cloneNode(this._ifClause_),
              cloneNode(this._restIf_));
      }
  
      public void apply(Switch sw)
      {
          ((Analysis) sw).caseAElseifRestIf(this);
      }
  
      public TElseif getElseif()
      {
          return this._elseif_;
      }
  
      public void setElseif(TElseif node)
      {
          if(this._elseif_ != null)
          {
              this._elseif_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._elseif_ = node;
      }
  
      public PIfClause getIfClause()
      {
          return this._ifClause_;
      }
  
      public void setIfClause(PIfClause node)
      {
          if(this._ifClause_ != null)
          {
              this._ifClause_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._ifClause_ = node;
      }
  
      public PRestIf getRestIf()
      {
          return this._restIf_;
      }
  
      public void setRestIf(PRestIf node)
      {
          if(this._restIf_ != null)
          {
              this._restIf_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._restIf_ = node;
      }
  
      @Override
      public String toString()
      {
          return ""
              + toString(this._elseif_)
              + toString(this._ifClause_)
              + toString(this._restIf_);
      }
  
      @Override
      void removeChild(@SuppressWarnings("unused") Node child)
      {
          // Remove child
          if(this._elseif_ == child)
          {
              this._elseif_ = null;
              return;
          }
  
          if(this._ifClause_ == child)
          {
              this._ifClause_ = null;
              return;
          }
  
          if(this._restIf_ == child)
          {
              this._restIf_ = null;
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  
      @Override
      void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
      {
          // Replace child
          if(this._elseif_ == oldChild)
          {
              setElseif((TElseif) newChild);
              return;
          }
  
          if(this._ifClause_ == oldChild)
          {
              setIfClause((PIfClause) newChild);
              return;
          }
  
          if(this._restIf_ == oldChild)
          {
              setRestIf((PRestIf) newChild);
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  }
  