content: /* This file was generated by SableCC (http://www.sablecc.org/). */
  
  package com.abstratt.mdd.frontend.textuml.grammar.node;
  
  import java.util.*;
  import com.abstratt.mdd.frontend.textuml.grammar.analysis.*;
  
  @SuppressWarnings("nls")
  public final class ARaisedExceptionList extends PRaisedExceptionList
  {
      private PRaisedExceptionItem _raisedExceptionItem_;
      private final LinkedList<PRaisedExceptionListTail> _raisedExceptionListTail_ = new LinkedList<PRaisedExceptionListTail>();
  
      public ARaisedExceptionList()
      {
          // Constructor
      }
  
      public ARaisedExceptionList(
          @SuppressWarnings("hiding") PRaisedExceptionItem _raisedExceptionItem_,
          @SuppressWarnings("hiding") List<PRaisedExceptionListTail> _raisedExceptionListTail_)
      {
          // Constructor
          setRaisedExceptionItem(_raisedExceptionItem_);
  
          setRaisedExceptionListTail(_raisedExceptionListTail_);
  
      }
  
      @Override
      public Object clone()
      {
          return new ARaisedExceptionList(
              cloneNode(this._raisedExceptionItem_),
              cloneList(this._raisedExceptionListTail_));
      }
  
      public void apply(Switch sw)
      {
          ((Analysis) sw).caseARaisedExceptionList(this);
      }
  
      public PRaisedExceptionItem getRaisedExceptionItem()
      {
          return this._raisedExceptionItem_;
      }
  
      public void setRaisedExceptionItem(PRaisedExceptionItem node)
      {
          if(this._raisedExceptionItem_ != null)
          {
              this._raisedExceptionItem_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._raisedExceptionItem_ = node;
      }
  
      public LinkedList<PRaisedExceptionListTail> getRaisedExceptionListTail()
      {
          return this._raisedExceptionListTail_;
      }
  
      public void setRaisedExceptionListTail(List<PRaisedExceptionListTail> list)
      {
          this._raisedExceptionListTail_.clear();
          this._raisedExceptionListTail_.addAll(list);
          for(PRaisedExceptionListTail e : list)
          {
              if(e.parent() != null)
              {
                  e.parent().removeChild(e);
              }
  
              e.parent(this);
          }
      }
  
      @Override
      public String toString()
      {
          return ""
              + toString(this._raisedExceptionItem_)
              + toString(this._raisedExceptionListTail_);
      }
  
      @Override
      void removeChild(@SuppressWarnings("unused") Node child)
      {
          // Remove child
          if(this._raisedExceptionItem_ == child)
          {
              this._raisedExceptionItem_ = null;
              return;
          }
  
          if(this._raisedExceptionListTail_.remove(child))
          {
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  
      @Override
      void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
      {
          // Replace child
          if(this._raisedExceptionItem_ == oldChild)
          {
              setRaisedExceptionItem((PRaisedExceptionItem) newChild);
              return;
          }
  
          for(ListIterator<PRaisedExceptionListTail> i = this._raisedExceptionListTail_.listIterator(); i.hasNext();)
          {
              if(i.next() == oldChild)
              {
                  if(newChild != null)
                  {
                      i.set((PRaisedExceptionListTail) newChild);
                      newChild.parent(this);
                      oldChild.parent(null);
                      return;
                  }
  
                  i.remove();
                  oldChild.parent(null);
                  return;
              }
          }
  
          throw new RuntimeException("Not a child.");
      }
  }
  