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 AMinimalTypeIdentifierList extends PMinimalTypeIdentifierList
  {
      private PMinimalTypeIdentifier _minimalTypeIdentifier_;
      private final LinkedList<PMinimalTypeIdentifierListTail> _minimalTypeIdentifierListTail_ = new LinkedList<PMinimalTypeIdentifierListTail>();
  
      public AMinimalTypeIdentifierList()
      {
          // Constructor
      }
  
      public AMinimalTypeIdentifierList(
          @SuppressWarnings("hiding") PMinimalTypeIdentifier _minimalTypeIdentifier_,
          @SuppressWarnings("hiding") List<PMinimalTypeIdentifierListTail> _minimalTypeIdentifierListTail_)
      {
          // Constructor
          setMinimalTypeIdentifier(_minimalTypeIdentifier_);
  
          setMinimalTypeIdentifierListTail(_minimalTypeIdentifierListTail_);
  
      }
  
      @Override
      public Object clone()
      {
          return new AMinimalTypeIdentifierList(
              cloneNode(this._minimalTypeIdentifier_),
              cloneList(this._minimalTypeIdentifierListTail_));
      }
  
      public void apply(Switch sw)
      {
          ((Analysis) sw).caseAMinimalTypeIdentifierList(this);
      }
  
      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 LinkedList<PMinimalTypeIdentifierListTail> getMinimalTypeIdentifierListTail()
      {
          return this._minimalTypeIdentifierListTail_;
      }
  
      public void setMinimalTypeIdentifierListTail(List<PMinimalTypeIdentifierListTail> list)
      {
          this._minimalTypeIdentifierListTail_.clear();
          this._minimalTypeIdentifierListTail_.addAll(list);
          for(PMinimalTypeIdentifierListTail e : list)
          {
              if(e.parent() != null)
              {
                  e.parent().removeChild(e);
              }
  
              e.parent(this);
          }
      }
  
      @Override
      public String toString()
      {
          return ""
              + toString(this._minimalTypeIdentifier_)
              + toString(this._minimalTypeIdentifierListTail_);
      }
  
      @Override
      void removeChild(@SuppressWarnings("unused") Node child)
      {
          // Remove child
          if(this._minimalTypeIdentifier_ == child)
          {
              this._minimalTypeIdentifier_ = null;
              return;
          }
  
          if(this._minimalTypeIdentifierListTail_.remove(child))
          {
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  
      @Override
      void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
      {
          // Replace child
          if(this._minimalTypeIdentifier_ == oldChild)
          {
              setMinimalTypeIdentifier((PMinimalTypeIdentifier) newChild);
              return;
          }
  
          for(ListIterator<PMinimalTypeIdentifierListTail> i = this._minimalTypeIdentifierListTail_.listIterator(); i.hasNext();)
          {
              if(i.next() == oldChild)
              {
                  if(newChild != null)
                  {
                      i.set((PMinimalTypeIdentifierListTail) newChild);
                      newChild.parent(this);
                      oldChild.parent(null);
                      return;
                  }
  
                  i.remove();
                  oldChild.parent(null);
                  return;
              }
          }
  
          throw new RuntimeException("Not a child.");
      }
  }
  