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 ATupleConstructor extends PTupleConstructor
  {
      private TLCurlyBracket _lCurlyBracket_;
      private PTupleComponentValue _tupleComponentValue_;
      private final LinkedList<PTupleComponentValueTail> _tupleComponentValueTail_ = new LinkedList<PTupleComponentValueTail>();
      private TRCurlyBracket _rCurlyBracket_;
  
      public ATupleConstructor()
      {
          // Constructor
      }
  
      public ATupleConstructor(
          @SuppressWarnings("hiding") TLCurlyBracket _lCurlyBracket_,
          @SuppressWarnings("hiding") PTupleComponentValue _tupleComponentValue_,
          @SuppressWarnings("hiding") List<PTupleComponentValueTail> _tupleComponentValueTail_,
          @SuppressWarnings("hiding") TRCurlyBracket _rCurlyBracket_)
      {
          // Constructor
          setLCurlyBracket(_lCurlyBracket_);
  
          setTupleComponentValue(_tupleComponentValue_);
  
          setTupleComponentValueTail(_tupleComponentValueTail_);
  
          setRCurlyBracket(_rCurlyBracket_);
  
      }
  
      @Override
      public Object clone()
      {
          return new ATupleConstructor(
              cloneNode(this._lCurlyBracket_),
              cloneNode(this._tupleComponentValue_),
              cloneList(this._tupleComponentValueTail_),
              cloneNode(this._rCurlyBracket_));
      }
  
      public void apply(Switch sw)
      {
          ((Analysis) sw).caseATupleConstructor(this);
      }
  
      public TLCurlyBracket getLCurlyBracket()
      {
          return this._lCurlyBracket_;
      }
  
      public void setLCurlyBracket(TLCurlyBracket node)
      {
          if(this._lCurlyBracket_ != null)
          {
              this._lCurlyBracket_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._lCurlyBracket_ = node;
      }
  
      public PTupleComponentValue getTupleComponentValue()
      {
          return this._tupleComponentValue_;
      }
  
      public void setTupleComponentValue(PTupleComponentValue node)
      {
          if(this._tupleComponentValue_ != null)
          {
              this._tupleComponentValue_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._tupleComponentValue_ = node;
      }
  
      public LinkedList<PTupleComponentValueTail> getTupleComponentValueTail()
      {
          return this._tupleComponentValueTail_;
      }
  
      public void setTupleComponentValueTail(List<PTupleComponentValueTail> list)
      {
          this._tupleComponentValueTail_.clear();
          this._tupleComponentValueTail_.addAll(list);
          for(PTupleComponentValueTail e : list)
          {
              if(e.parent() != null)
              {
                  e.parent().removeChild(e);
              }
  
              e.parent(this);
          }
      }
  
      public TRCurlyBracket getRCurlyBracket()
      {
          return this._rCurlyBracket_;
      }
  
      public void setRCurlyBracket(TRCurlyBracket node)
      {
          if(this._rCurlyBracket_ != null)
          {
              this._rCurlyBracket_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._rCurlyBracket_ = node;
      }
  
      @Override
      public String toString()
      {
          return ""
              + toString(this._lCurlyBracket_)
              + toString(this._tupleComponentValue_)
              + toString(this._tupleComponentValueTail_)
              + toString(this._rCurlyBracket_);
      }
  
      @Override
      void removeChild(@SuppressWarnings("unused") Node child)
      {
          // Remove child
          if(this._lCurlyBracket_ == child)
          {
              this._lCurlyBracket_ = null;
              return;
          }
  
          if(this._tupleComponentValue_ == child)
          {
              this._tupleComponentValue_ = null;
              return;
          }
  
          if(this._tupleComponentValueTail_.remove(child))
          {
              return;
          }
  
          if(this._rCurlyBracket_ == child)
          {
              this._rCurlyBracket_ = null;
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  
      @Override
      void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
      {
          // Replace child
          if(this._lCurlyBracket_ == oldChild)
          {
              setLCurlyBracket((TLCurlyBracket) newChild);
              return;
          }
  
          if(this._tupleComponentValue_ == oldChild)
          {
              setTupleComponentValue((PTupleComponentValue) newChild);
              return;
          }
  
          for(ListIterator<PTupleComponentValueTail> i = this._tupleComponentValueTail_.listIterator(); i.hasNext();)
          {
              if(i.next() == oldChild)
              {
                  if(newChild != null)
                  {
                      i.set((PTupleComponentValueTail) newChild);
                      newChild.parent(this);
                      oldChild.parent(null);
                      return;
                  }
  
                  i.remove();
                  oldChild.parent(null);
                  return;
              }
          }
  
          if(this._rCurlyBracket_ == oldChild)
          {
              setRCurlyBracket((TRCurlyBracket) newChild);
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  }
  