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 AClassSpecializesList extends PClassSpecializesList
  {
      private PClassSpecializesItem _classSpecializesItem_;
      private final LinkedList<PClassSpecializesListTail> _classSpecializesListTail_ = new LinkedList<PClassSpecializesListTail>();
  
      public AClassSpecializesList()
      {
          // Constructor
      }
  
      public AClassSpecializesList(
          @SuppressWarnings("hiding") PClassSpecializesItem _classSpecializesItem_,
          @SuppressWarnings("hiding") List<PClassSpecializesListTail> _classSpecializesListTail_)
      {
          // Constructor
          setClassSpecializesItem(_classSpecializesItem_);
  
          setClassSpecializesListTail(_classSpecializesListTail_);
  
      }
  
      @Override
      public Object clone()
      {
          return new AClassSpecializesList(
              cloneNode(this._classSpecializesItem_),
              cloneList(this._classSpecializesListTail_));
      }
  
      public void apply(Switch sw)
      {
          ((Analysis) sw).caseAClassSpecializesList(this);
      }
  
      public PClassSpecializesItem getClassSpecializesItem()
      {
          return this._classSpecializesItem_;
      }
  
      public void setClassSpecializesItem(PClassSpecializesItem node)
      {
          if(this._classSpecializesItem_ != null)
          {
              this._classSpecializesItem_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._classSpecializesItem_ = node;
      }
  
      public LinkedList<PClassSpecializesListTail> getClassSpecializesListTail()
      {
          return this._classSpecializesListTail_;
      }
  
      public void setClassSpecializesListTail(List<PClassSpecializesListTail> list)
      {
          this._classSpecializesListTail_.clear();
          this._classSpecializesListTail_.addAll(list);
          for(PClassSpecializesListTail e : list)
          {
              if(e.parent() != null)
              {
                  e.parent().removeChild(e);
              }
  
              e.parent(this);
          }
      }
  
      @Override
      public String toString()
      {
          return ""
              + toString(this._classSpecializesItem_)
              + toString(this._classSpecializesListTail_);
      }
  
      @Override
      void removeChild(@SuppressWarnings("unused") Node child)
      {
          // Remove child
          if(this._classSpecializesItem_ == child)
          {
              this._classSpecializesItem_ = null;
              return;
          }
  
          if(this._classSpecializesListTail_.remove(child))
          {
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  
      @Override
      void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
      {
          // Replace child
          if(this._classSpecializesItem_ == oldChild)
          {
              setClassSpecializesItem((PClassSpecializesItem) newChild);
              return;
          }
  
          for(ListIterator<PClassSpecializesListTail> i = this._classSpecializesListTail_.listIterator(); i.hasNext();)
          {
              if(i.next() == oldChild)
              {
                  if(newChild != null)
                  {
                      i.set((PClassSpecializesListTail) newChild);
                      newChild.parent(this);
                      oldChild.parent(null);
                      return;
                  }
  
                  i.remove();
                  oldChild.parent(null);
                  return;
              }
          }
  
          throw new RuntimeException("Not a child.");
      }
  }
  