gt:         throw new RuntimeException("Not a child.");
context: /* This file was generated by SableCC (http://www.sablecc.org/). */
  
  package se.sics.kola.node;
  
  import java.util.*;
  import se.sics.kola.analysis.*;
  
  @SuppressWarnings("nls")
  public final class APrimaryExplicitConstructorInvocation extends PExplicitConstructorInvocation
  {
      private PExpressionNoName _expressionNoName_;
      private final LinkedList<PReferenceType> _nonWildTypeArguments_ = new LinkedList<PReferenceType>();
      private final LinkedList<PArgument> _argument_ = new LinkedList<PArgument>();
  
      public APrimaryExplicitConstructorInvocation()
      {
          // Constructor
      }
  
      public APrimaryExplicitConstructorInvocation(
          @SuppressWarnings("hiding") PExpressionNoName _expressionNoName_,
          @SuppressWarnings("hiding") List<?> _nonWildTypeArguments_,
          @SuppressWarnings("hiding") List<?> _argument_)
      {
          // Constructor
          setExpressionNoName(_expressionNoName_);
  
          setNonWildTypeArguments(_nonWildTypeArguments_);
  
          setArgument(_argument_);
  
      }
  
      @Override
      public Object clone()
      {
          return new APrimaryExplicitConstructorInvocation(
              cloneNode(this._expressionNoName_),
              cloneList(this._nonWildTypeArguments_),
              cloneList(this._argument_));
      }
  
      @Override
      public void apply(Switch sw)
      {
          ((Analysis) sw).caseAPrimaryExplicitConstructorInvocation(this);
      }
  
      public PExpressionNoName getExpressionNoName()
      {
          return this._expressionNoName_;
      }
  
      public void setExpressionNoName(PExpressionNoName node)
      {
          if(this._expressionNoName_ != null)
          {
              this._expressionNoName_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._expressionNoName_ = node;
      }
  
      public LinkedList<PReferenceType> getNonWildTypeArguments()
      {
          return this._nonWildTypeArguments_;
      }
  
      public void setNonWildTypeArguments(List<?> list)
      {
          for(PReferenceType e : this._nonWildTypeArguments_)
          {
              e.parent(null);
          }
          this._nonWildTypeArguments_.clear();
  
          for(Object obj_e : list)
          {
              PReferenceType e = (PReferenceType) obj_e;
              if(e.parent() != null)
              {
                  e.parent().removeChild(e);
              }
  
              e.parent(this);
              this._nonWildTypeArguments_.add(e);
          }
      }
  
      public LinkedList<PArgument> getArgument()
      {
          return this._argument_;
      }
  
      public void setArgument(List<?> list)
      {
          for(PArgument e : this._argument_)
          {
              e.parent(null);
          }
          this._argument_.clear();
  
          for(Object obj_e : list)
          {
              PArgument e = (PArgument) obj_e;
              if(e.parent() != null)
              {
                  e.parent().removeChild(e);
              }
  
              e.parent(this);
              this._argument_.add(e);
          }
      }
  
      @Override
      public String toString()
      {
          return ""
              + toString(this._expressionNoName_)
              + toString(this._nonWildTypeArguments_)
              + toString(this._argument_);
      }
  
      @Override
      void removeChild(@SuppressWarnings("unused") Node child)
      {
          // Remove child
          if(this._expressionNoName_ == child)
          {
              this._expressionNoName_ = null;
              return;
          }
  
          if(this._nonWildTypeArguments_.remove(child))
          {
              return;
          }
  
          if(this._argument_.remove(child))
          {
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  
      @Override
      void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
      {
          // Replace child
          if(this._expressionNoName_ == oldChild)
          {
              setExpressionNoName((PExpressionNoName) newChild);
              return;
          }
  
          for(ListIterator<PReferenceType> i = this._nonWildTypeArguments_.listIterator(); i.hasNext();)
          {
              if(i.next() == oldChild)
              {
                  if(newChild != null)
                  {
                      i.set((PReferenceType) newChild);
                      newChild.parent(this);
                      oldChild.parent(null);
                      return;
                  }
  
                  i.remove();
                  oldChild.parent(null);
                  return;
              }
          }
  
          for(ListIterator<PArgument> i = this._argument_.listIterator(); i.hasNext();)
          {
              if(i.next() == oldChild)
              {
                  if(newChild != null)
                  {
                      i.set((PArgument) newChild);
                      newChild.parent(this);
                      oldChild.parent(null);
                      return;
                  }
  
                  i.remove();
                  oldChild.parent(null);
                  return;
              }
          }
  
  