content: /* This file was generated by SableCC (http://www.sablecc.org/). */
  
  package com.abstratt.mdd.frontend.textuml.grammar.node;
  
  import com.abstratt.mdd.frontend.textuml.grammar.analysis.*;
  
  @SuppressWarnings("nls")
  public final class AOptionalMultiplicity extends POptionalMultiplicity
  {
      private TLBracket _lBracket_;
      private PMultiplicitySpec _multiplicitySpec_;
      private TRBracket _rBracket_;
      private PMultiplicityConstraints _multiplicityConstraints_;
  
      public AOptionalMultiplicity()
      {
          // Constructor
      }
  
      public AOptionalMultiplicity(
          @SuppressWarnings("hiding") TLBracket _lBracket_,
          @SuppressWarnings("hiding") PMultiplicitySpec _multiplicitySpec_,
          @SuppressWarnings("hiding") TRBracket _rBracket_,
          @SuppressWarnings("hiding") PMultiplicityConstraints _multiplicityConstraints_)
      {
          // Constructor
          setLBracket(_lBracket_);
  
          setMultiplicitySpec(_multiplicitySpec_);
  
          setRBracket(_rBracket_);
  
          setMultiplicityConstraints(_multiplicityConstraints_);
  
      }
  
      @Override
      public Object clone()
      {
          return new AOptionalMultiplicity(
              cloneNode(this._lBracket_),
              cloneNode(this._multiplicitySpec_),
              cloneNode(this._rBracket_),
              cloneNode(this._multiplicityConstraints_));
      }
  
      public void apply(Switch sw)
      {
          ((Analysis) sw).caseAOptionalMultiplicity(this);
      }
  
      public TLBracket getLBracket()
      {
          return this._lBracket_;
      }
  
      public void setLBracket(TLBracket node)
      {
          if(this._lBracket_ != null)
          {
              this._lBracket_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._lBracket_ = node;
      }
  
      public PMultiplicitySpec getMultiplicitySpec()
      {
          return this._multiplicitySpec_;
      }
  
      public void setMultiplicitySpec(PMultiplicitySpec node)
      {
          if(this._multiplicitySpec_ != null)
          {
              this._multiplicitySpec_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._multiplicitySpec_ = node;
      }
  
      public TRBracket getRBracket()
      {
          return this._rBracket_;
      }
  
      public void setRBracket(TRBracket node)
      {
          if(this._rBracket_ != null)
          {
              this._rBracket_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._rBracket_ = node;
      }
  
      public PMultiplicityConstraints getMultiplicityConstraints()
      {
          return this._multiplicityConstraints_;
      }
  
      public void setMultiplicityConstraints(PMultiplicityConstraints node)
      {
          if(this._multiplicityConstraints_ != null)
          {
              this._multiplicityConstraints_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._multiplicityConstraints_ = node;
      }
  
      @Override
      public String toString()
      {
          return ""
              + toString(this._lBracket_)
              + toString(this._multiplicitySpec_)
              + toString(this._rBracket_)
              + toString(this._multiplicityConstraints_);
      }
  
      @Override
      void removeChild(@SuppressWarnings("unused") Node child)
      {
          // Remove child
          if(this._lBracket_ == child)
          {
              this._lBracket_ = null;
              return;
          }
  
          if(this._multiplicitySpec_ == child)
          {
              this._multiplicitySpec_ = null;
              return;
          }
  
          if(this._rBracket_ == child)
          {
              this._rBracket_ = null;
              return;
          }
  
          if(this._multiplicityConstraints_ == child)
          {
              this._multiplicityConstraints_ = null;
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  
      @Override
      void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
      {
          // Replace child
          if(this._lBracket_ == oldChild)
          {
              setLBracket((TLBracket) newChild);
              return;
          }
  
          if(this._multiplicitySpec_ == oldChild)
          {
              setMultiplicitySpec((PMultiplicitySpec) newChild);
              return;
          }
  
          if(this._rBracket_ == oldChild)
          {
              setRBracket((TRBracket) newChild);
              return;
          }
  
          if(this._multiplicityConstraints_ == oldChild)
          {
              setMultiplicityConstraints((PMultiplicityConstraints) newChild);
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  }
  