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 APrimitiveDef extends PPrimitiveDef
  {
      private PAnnotations _annotations_;
      private PVisibilityModifier _visibilityModifier_;
      private TPrimitive _primitive_;
      private TIdentifier _identifier_;
      private TSemicolon _semicolon_;
  
      public APrimitiveDef()
      {
          // Constructor
      }
  
      public APrimitiveDef(
          @SuppressWarnings("hiding") PAnnotations _annotations_,
          @SuppressWarnings("hiding") PVisibilityModifier _visibilityModifier_,
          @SuppressWarnings("hiding") TPrimitive _primitive_,
          @SuppressWarnings("hiding") TIdentifier _identifier_,
          @SuppressWarnings("hiding") TSemicolon _semicolon_)
      {
          // Constructor
          setAnnotations(_annotations_);
  
          setVisibilityModifier(_visibilityModifier_);
  
          setPrimitive(_primitive_);
  
          setIdentifier(_identifier_);
  
          setSemicolon(_semicolon_);
  
      }
  
      @Override
      public Object clone()
      {
          return new APrimitiveDef(
              cloneNode(this._annotations_),
              cloneNode(this._visibilityModifier_),
              cloneNode(this._primitive_),
              cloneNode(this._identifier_),
              cloneNode(this._semicolon_));
      }
  
      public void apply(Switch sw)
      {
          ((Analysis) sw).caseAPrimitiveDef(this);
      }
  
      public PAnnotations getAnnotations()
      {
          return this._annotations_;
      }
  
      public void setAnnotations(PAnnotations node)
      {
          if(this._annotations_ != null)
          {
              this._annotations_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._annotations_ = node;
      }
  
      public PVisibilityModifier getVisibilityModifier()
      {
          return this._visibilityModifier_;
      }
  
      public void setVisibilityModifier(PVisibilityModifier node)
      {
          if(this._visibilityModifier_ != null)
          {
              this._visibilityModifier_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._visibilityModifier_ = node;
      }
  
      public TPrimitive getPrimitive()
      {
          return this._primitive_;
      }
  
      public void setPrimitive(TPrimitive node)
      {
          if(this._primitive_ != null)
          {
              this._primitive_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._primitive_ = 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 TSemicolon getSemicolon()
      {
          return this._semicolon_;
      }
  
      public void setSemicolon(TSemicolon node)
      {
          if(this._semicolon_ != null)
          {
              this._semicolon_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._semicolon_ = node;
      }
  
      @Override
      public String toString()
      {
          return ""
              + toString(this._annotations_)
              + toString(this._visibilityModifier_)
              + toString(this._primitive_)
              + toString(this._identifier_)
              + toString(this._semicolon_);
      }
  
      @Override
      void removeChild(@SuppressWarnings("unused") Node child)
      {
          // Remove child
          if(this._annotations_ == child)
          {
              this._annotations_ = null;
              return;
          }
  
          if(this._visibilityModifier_ == child)
          {
              this._visibilityModifier_ = null;
              return;
          }
  
          if(this._primitive_ == child)
          {
              this._primitive_ = null;
              return;
          }
  
          if(this._identifier_ == child)
          {
              this._identifier_ = null;
              return;
          }
  
          if(this._semicolon_ == child)
          {
              this._semicolon_ = null;
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  
      @Override
      void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
      {
          // Replace child
          if(this._annotations_ == oldChild)
          {
              setAnnotations((PAnnotations) newChild);
              return;
          }
  
          if(this._visibilityModifier_ == oldChild)
          {
              setVisibilityModifier((PVisibilityModifier) newChild);
              return;
          }
  
          if(this._primitive_ == oldChild)
          {
              setPrimitive((TPrimitive) newChild);
              return;
          }
  
          if(this._identifier_ == oldChild)
          {
              setIdentifier((TIdentifier) newChild);
              return;
          }
  
          if(this._semicolon_ == oldChild)
          {
              setSemicolon((TSemicolon) newChild);
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  }
  