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 ATernaryExpression extends PTernaryExpression
  {
      private PExpressionP4 _condition_;
      private TQuestion _question_;
      private PExpressionP5 _trueExpression_;
      private TColon _colon_;
      private PExpressionP5 _falseExpression_;
  
      public ATernaryExpression()
      {
          // Constructor
      }
  
      public ATernaryExpression(
          @SuppressWarnings("hiding") PExpressionP4 _condition_,
          @SuppressWarnings("hiding") TQuestion _question_,
          @SuppressWarnings("hiding") PExpressionP5 _trueExpression_,
          @SuppressWarnings("hiding") TColon _colon_,
          @SuppressWarnings("hiding") PExpressionP5 _falseExpression_)
      {
          // Constructor
          setCondition(_condition_);
  
          setQuestion(_question_);
  
          setTrueExpression(_trueExpression_);
  
          setColon(_colon_);
  
          setFalseExpression(_falseExpression_);
  
      }
  
      @Override
      public Object clone()
      {
          return new ATernaryExpression(
              cloneNode(this._condition_),
              cloneNode(this._question_),
              cloneNode(this._trueExpression_),
              cloneNode(this._colon_),
              cloneNode(this._falseExpression_));
      }
  
      public void apply(Switch sw)
      {
          ((Analysis) sw).caseATernaryExpression(this);
      }
  
      public PExpressionP4 getCondition()
      {
          return this._condition_;
      }
  
      public void setCondition(PExpressionP4 node)
      {
          if(this._condition_ != null)
          {
              this._condition_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._condition_ = node;
      }
  
      public TQuestion getQuestion()
      {
          return this._question_;
      }
  
      public void setQuestion(TQuestion node)
      {
          if(this._question_ != null)
          {
              this._question_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._question_ = node;
      }
  
      public PExpressionP5 getTrueExpression()
      {
          return this._trueExpression_;
      }
  
      public void setTrueExpression(PExpressionP5 node)
      {
          if(this._trueExpression_ != null)
          {
              this._trueExpression_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._trueExpression_ = node;
      }
  
      public TColon getColon()
      {
          return this._colon_;
      }
  
      public void setColon(TColon node)
      {
          if(this._colon_ != null)
          {
              this._colon_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._colon_ = node;
      }
  
      public PExpressionP5 getFalseExpression()
      {
          return this._falseExpression_;
      }
  
      public void setFalseExpression(PExpressionP5 node)
      {
          if(this._falseExpression_ != null)
          {
              this._falseExpression_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._falseExpression_ = node;
      }
  
      @Override
      public String toString()
      {
          return ""
              + toString(this._condition_)
              + toString(this._question_)
              + toString(this._trueExpression_)
              + toString(this._colon_)
              + toString(this._falseExpression_);
      }
  
      @Override
      void removeChild(@SuppressWarnings("unused") Node child)
      {
          // Remove child
          if(this._condition_ == child)
          {
              this._condition_ = null;
              return;
          }
  
          if(this._question_ == child)
          {
              this._question_ = null;
              return;
          }
  
          if(this._trueExpression_ == child)
          {
              this._trueExpression_ = null;
              return;
          }
  
          if(this._colon_ == child)
          {
              this._colon_ = null;
              return;
          }
  
          if(this._falseExpression_ == child)
          {
              this._falseExpression_ = null;
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  
      @Override
      void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
      {
          // Replace child
          if(this._condition_ == oldChild)
          {
              setCondition((PExpressionP4) newChild);
              return;
          }
  
          if(this._question_ == oldChild)
          {
              setQuestion((TQuestion) newChild);
              return;
          }
  
          if(this._trueExpression_ == oldChild)
          {
              setTrueExpression((PExpressionP5) newChild);
              return;
          }
  
          if(this._colon_ == oldChild)
          {
              setColon((TColon) newChild);
              return;
          }
  
          if(this._falseExpression_ == oldChild)
          {
              setFalseExpression((PExpressionP5) newChild);
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  }
  