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 ASubNamespace extends PSubNamespace
  {
      private PPackageHeading _packageHeading_;
      private PGlobalDirectiveSection _globalDirectiveSection_;
      private PNamespaceContents _namespaceContents_;
      private TEnd _end_;
      private TSemicolon _semicolon_;
  
      public ASubNamespace()
      {
          // Constructor
      }
  
      public ASubNamespace(
          @SuppressWarnings("hiding") PPackageHeading _packageHeading_,
          @SuppressWarnings("hiding") PGlobalDirectiveSection _globalDirectiveSection_,
          @SuppressWarnings("hiding") PNamespaceContents _namespaceContents_,
          @SuppressWarnings("hiding") TEnd _end_,
          @SuppressWarnings("hiding") TSemicolon _semicolon_)
      {
          // Constructor
          setPackageHeading(_packageHeading_);
  
          setGlobalDirectiveSection(_globalDirectiveSection_);
  
          setNamespaceContents(_namespaceContents_);
  
          setEnd(_end_);
  
          setSemicolon(_semicolon_);
  
      }
  
      @Override
      public Object clone()
      {
          return new ASubNamespace(
              cloneNode(this._packageHeading_),
              cloneNode(this._globalDirectiveSection_),
              cloneNode(this._namespaceContents_),
              cloneNode(this._end_),
              cloneNode(this._semicolon_));
      }
  
      public void apply(Switch sw)
      {
          ((Analysis) sw).caseASubNamespace(this);
      }
  
      public PPackageHeading getPackageHeading()
      {
          return this._packageHeading_;
      }
  
      public void setPackageHeading(PPackageHeading node)
      {
          if(this._packageHeading_ != null)
          {
              this._packageHeading_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._packageHeading_ = node;
      }
  
      public PGlobalDirectiveSection getGlobalDirectiveSection()
      {
          return this._globalDirectiveSection_;
      }
  
      public void setGlobalDirectiveSection(PGlobalDirectiveSection node)
      {
          if(this._globalDirectiveSection_ != null)
          {
              this._globalDirectiveSection_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._globalDirectiveSection_ = node;
      }
  
      public PNamespaceContents getNamespaceContents()
      {
          return this._namespaceContents_;
      }
  
      public void setNamespaceContents(PNamespaceContents node)
      {
          if(this._namespaceContents_ != null)
          {
              this._namespaceContents_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._namespaceContents_ = node;
      }
  
      public TEnd getEnd()
      {
          return this._end_;
      }
  
      public void setEnd(TEnd node)
      {
          if(this._end_ != null)
          {
              this._end_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._end_ = 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._packageHeading_)
              + toString(this._globalDirectiveSection_)
              + toString(this._namespaceContents_)
              + toString(this._end_)
              + toString(this._semicolon_);
      }
  
      @Override
      void removeChild(@SuppressWarnings("unused") Node child)
      {
          // Remove child
          if(this._packageHeading_ == child)
          {
              this._packageHeading_ = null;
              return;
          }
  
          if(this._globalDirectiveSection_ == child)
          {
              this._globalDirectiveSection_ = null;
              return;
          }
  
          if(this._namespaceContents_ == child)
          {
              this._namespaceContents_ = null;
              return;
          }
  
          if(this._end_ == child)
          {
              this._end_ = 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._packageHeading_ == oldChild)
          {
              setPackageHeading((PPackageHeading) newChild);
              return;
          }
  
          if(this._globalDirectiveSection_ == oldChild)
          {
              setGlobalDirectiveSection((PGlobalDirectiveSection) newChild);
              return;
          }
  
          if(this._namespaceContents_ == oldChild)
          {
              setNamespaceContents((PNamespaceContents) newChild);
              return;
          }
  
          if(this._end_ == oldChild)
          {
              setEnd((TEnd) newChild);
              return;
          }
  
          if(this._semicolon_ == oldChild)
          {
              setSemicolon((TSemicolon) newChild);
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  }
  