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 AAttributeInvariant extends PAttributeInvariant
  {
      private TModelComment _modelComment_;
      private PAnnotations _annotations_;
      private PInvariantKernel _invariantKernel_;
  
      public AAttributeInvariant()
      {
          // Constructor
      }
  
      public AAttributeInvariant(
          @SuppressWarnings("hiding") TModelComment _modelComment_,
          @SuppressWarnings("hiding") PAnnotations _annotations_,
          @SuppressWarnings("hiding") PInvariantKernel _invariantKernel_)
      {
          // Constructor
          setModelComment(_modelComment_);
  
          setAnnotations(_annotations_);
  
          setInvariantKernel(_invariantKernel_);
  
      }
  
      @Override
      public Object clone()
      {
          return new AAttributeInvariant(
              cloneNode(this._modelComment_),
              cloneNode(this._annotations_),
              cloneNode(this._invariantKernel_));
      }
  
      public void apply(Switch sw)
      {
          ((Analysis) sw).caseAAttributeInvariant(this);
      }
  
      public TModelComment getModelComment()
      {
          return this._modelComment_;
      }
  
      public void setModelComment(TModelComment node)
      {
          if(this._modelComment_ != null)
          {
              this._modelComment_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._modelComment_ = node;
      }
  
      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 PInvariantKernel getInvariantKernel()
      {
          return this._invariantKernel_;
      }
  
      public void setInvariantKernel(PInvariantKernel node)
      {
          if(this._invariantKernel_ != null)
          {
              this._invariantKernel_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._invariantKernel_ = node;
      }
  
      @Override
      public String toString()
      {
          return ""
              + toString(this._modelComment_)
              + toString(this._annotations_)
              + toString(this._invariantKernel_);
      }
  
      @Override
      void removeChild(@SuppressWarnings("unused") Node child)
      {
          // Remove child
          if(this._modelComment_ == child)
          {
              this._modelComment_ = null;
              return;
          }
  
          if(this._annotations_ == child)
          {
              this._annotations_ = null;
              return;
          }
  
          if(this._invariantKernel_ == child)
          {
              this._invariantKernel_ = null;
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  
      @Override
      void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
      {
          // Replace child
          if(this._modelComment_ == oldChild)
          {
              setModelComment((TModelComment) newChild);
              return;
          }
  
          if(this._annotations_ == oldChild)
          {
              setAnnotations((PAnnotations) newChild);
              return;
          }
  
          if(this._invariantKernel_ == oldChild)
          {
              setInvariantKernel((PInvariantKernel) newChild);
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  }
  