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 ARegularInvariantConstraint extends PRegularInvariantConstraint
  {
      private TInvariant _invariant_;
      private TIdentifier _identifier_;
      private PConstraintException _constraintException_;
      private PExpressionBlock _expressionBlock_;
  
      public ARegularInvariantConstraint()
      {
          // Constructor
      }
  
      public ARegularInvariantConstraint(
          @SuppressWarnings("hiding") TInvariant _invariant_,
          @SuppressWarnings("hiding") TIdentifier _identifier_,
          @SuppressWarnings("hiding") PConstraintException _constraintException_,
          @SuppressWarnings("hiding") PExpressionBlock _expressionBlock_)
      {
          // Constructor
          setInvariant(_invariant_);
  
          setIdentifier(_identifier_);
  
          setConstraintException(_constraintException_);
  
          setExpressionBlock(_expressionBlock_);
  
      }
  
      @Override
      public Object clone()
      {
          return new ARegularInvariantConstraint(
              cloneNode(this._invariant_),
              cloneNode(this._identifier_),
              cloneNode(this._constraintException_),
              cloneNode(this._expressionBlock_));
      }
  
      public void apply(Switch sw)
      {
          ((Analysis) sw).caseARegularInvariantConstraint(this);
      }
  
      public TInvariant getInvariant()
      {
          return this._invariant_;
      }
  
      public void setInvariant(TInvariant node)
      {
          if(this._invariant_ != null)
          {
              this._invariant_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._invariant_ = node;
      }
  
      public TIdentifier getIdentifier()
      {
          return this._identifier_;
      }
  
      public void setIdentifier(TIdentifier node)
      {
          if(this._identifier_ != null)
          {
              this._identifier_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._identifier_ = node;
      }
  
      public PConstraintException getConstraintException()
      {
          return this._constraintException_;
      }
  
      public void setConstraintException(PConstraintException node)
      {
          if(this._constraintException_ != null)
          {
              this._constraintException_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._constraintException_ = node;
      }
  
      public PExpressionBlock getExpressionBlock()
      {
          return this._expressionBlock_;
      }
  
      public void setExpressionBlock(PExpressionBlock node)
      {
          if(this._expressionBlock_ != null)
          {
              this._expressionBlock_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._expressionBlock_ = node;
      }
  
      @Override
      public String toString()
      {
          return ""
              + toString(this._invariant_)
              + toString(this._identifier_)
              + toString(this._constraintException_)
              + toString(this._expressionBlock_);
      }
  
      @Override
      void removeChild(@SuppressWarnings("unused") Node child)
      {
          // Remove child
          if(this._invariant_ == child)
          {
              this._invariant_ = null;
              return;
          }
  
          if(this._identifier_ == child)
          {
              this._identifier_ = null;
              return;
          }
  
          if(this._constraintException_ == child)
          {
              this._constraintException_ = null;
              return;
          }
  
          if(this._expressionBlock_ == child)
          {
              this._expressionBlock_ = null;
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  
      @Override
      void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
      {
          // Replace child
          if(this._invariant_ == oldChild)
          {
              setInvariant((TInvariant) newChild);
              return;
          }
  
          if(this._identifier_ == oldChild)
          {
              setIdentifier((TIdentifier) newChild);
              return;
          }
  
          if(this._constraintException_ == oldChild)
          {
              setConstraintException((PConstraintException) newChild);
              return;
          }
  
          if(this._expressionBlock_ == oldChild)
          {
              setExpressionBlock((PExpressionBlock) newChild);
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  }
  