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 APortDecl extends PPortDecl
  {
      private PPortModifier _portModifier_;
      private TPort _port_;
      private TIdentifier _identifier_;
      private TColon _colon_;
      private PMinimalTypeIdentifier _minimalTypeIdentifier_;
      private PPortConnector _portConnector_;
      private TSemicolon _semicolon_;
  
      public APortDecl()
      {
          // Constructor
      }
  
      public APortDecl(
          @SuppressWarnings("hiding") PPortModifier _portModifier_,
          @SuppressWarnings("hiding") TPort _port_,
          @SuppressWarnings("hiding") TIdentifier _identifier_,
          @SuppressWarnings("hiding") TColon _colon_,
          @SuppressWarnings("hiding") PMinimalTypeIdentifier _minimalTypeIdentifier_,
          @SuppressWarnings("hiding") PPortConnector _portConnector_,
          @SuppressWarnings("hiding") TSemicolon _semicolon_)
      {
          // Constructor
          setPortModifier(_portModifier_);
  
          setPort(_port_);
  
          setIdentifier(_identifier_);
  
          setColon(_colon_);
  
          setMinimalTypeIdentifier(_minimalTypeIdentifier_);
  
          setPortConnector(_portConnector_);
  
          setSemicolon(_semicolon_);
  
      }
  
      @Override
      public Object clone()
      {
          return new APortDecl(
              cloneNode(this._portModifier_),
              cloneNode(this._port_),
              cloneNode(this._identifier_),
              cloneNode(this._colon_),
              cloneNode(this._minimalTypeIdentifier_),
              cloneNode(this._portConnector_),
              cloneNode(this._semicolon_));
      }
  
      public void apply(Switch sw)
      {
          ((Analysis) sw).caseAPortDecl(this);
      }
  
      public PPortModifier getPortModifier()
      {
          return this._portModifier_;
      }
  
      public void setPortModifier(PPortModifier node)
      {
          if(this._portModifier_ != null)
          {
              this._portModifier_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._portModifier_ = node;
      }
  
      public TPort getPort()
      {
          return this._port_;
      }
  
      public void setPort(TPort node)
      {
          if(this._port_ != null)
          {
              this._port_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._port_ = 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 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 PMinimalTypeIdentifier getMinimalTypeIdentifier()
      {
          return this._minimalTypeIdentifier_;
      }
  
      public void setMinimalTypeIdentifier(PMinimalTypeIdentifier node)
      {
          if(this._minimalTypeIdentifier_ != null)
          {
              this._minimalTypeIdentifier_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._minimalTypeIdentifier_ = node;
      }
  
      public PPortConnector getPortConnector()
      {
          return this._portConnector_;
      }
  
      public void setPortConnector(PPortConnector node)
      {
          if(this._portConnector_ != null)
          {
              this._portConnector_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._portConnector_ = 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._portModifier_)
              + toString(this._port_)
              + toString(this._identifier_)
              + toString(this._colon_)
              + toString(this._minimalTypeIdentifier_)
              + toString(this._portConnector_)
              + toString(this._semicolon_);
      }
  
      @Override
      void removeChild(@SuppressWarnings("unused") Node child)
      {
          // Remove child
          if(this._portModifier_ == child)
          {
              this._portModifier_ = null;
              return;
          }
  
          if(this._port_ == child)
          {
              this._port_ = null;
              return;
          }
  
          if(this._identifier_ == child)
          {
              this._identifier_ = null;
              return;
          }
  
          if(this._colon_ == child)
          {
              this._colon_ = null;
              return;
          }
  
          if(this._minimalTypeIdentifier_ == child)
          {
              this._minimalTypeIdentifier_ = null;
              return;
          }
  
          if(this._portConnector_ == child)
          {
              this._portConnector_ = 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._portModifier_ == oldChild)
          {
              setPortModifier((PPortModifier) newChild);
              return;
          }
  
          if(this._port_ == oldChild)
          {
              setPort((TPort) newChild);
              return;
          }
  
          if(this._identifier_ == oldChild)
          {
              setIdentifier((TIdentifier) newChild);
              return;
          }
  
          if(this._colon_ == oldChild)
          {
              setColon((TColon) newChild);
              return;
          }
  
          if(this._minimalTypeIdentifier_ == oldChild)
          {
              setMinimalTypeIdentifier((PMinimalTypeIdentifier) newChild);
              return;
          }
  
          if(this._portConnector_ == oldChild)
          {
              setPortConnector((PPortConnector) newChild);
              return;
          }
  
          if(this._semicolon_ == oldChild)
          {
              setSemicolon((TSemicolon) newChild);
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  }
  