All Downloads are FREE. Search and download functionalities are using the official Maven repository.

prerna.sablecc2.node.AOtherMapEntry Maven / Gradle / Ivy

The newest version!
/* This file was generated by SableCC (http://www.sablecc.org/). */

package prerna.sablecc2.node;

import prerna.sablecc2.analysis.*;

@SuppressWarnings("nls")
public final class AOtherMapEntry extends POtherMapEntry
{
    private TComma _comma_;
    private PMapEntry _mapEntry_;

    public AOtherMapEntry()
    {
        // Constructor
    }

    public AOtherMapEntry(
        @SuppressWarnings("hiding") TComma _comma_,
        @SuppressWarnings("hiding") PMapEntry _mapEntry_)
    {
        // Constructor
        setComma(_comma_);

        setMapEntry(_mapEntry_);

    }

    @Override
    public Object clone()
    {
        return new AOtherMapEntry(
            cloneNode(this._comma_),
            cloneNode(this._mapEntry_));
    }

    @Override
    public void apply(Switch sw)
    {
        ((Analysis) sw).caseAOtherMapEntry(this);
    }

    public TComma getComma()
    {
        return this._comma_;
    }

    public void setComma(TComma node)
    {
        if(this._comma_ != null)
        {
            this._comma_.parent(null);
        }

        if(node != null)
        {
            if(node.parent() != null)
            {
                node.parent().removeChild(node);
            }

            node.parent(this);
        }

        this._comma_ = node;
    }

    public PMapEntry getMapEntry()
    {
        return this._mapEntry_;
    }

    public void setMapEntry(PMapEntry node)
    {
        if(this._mapEntry_ != null)
        {
            this._mapEntry_.parent(null);
        }

        if(node != null)
        {
            if(node.parent() != null)
            {
                node.parent().removeChild(node);
            }

            node.parent(this);
        }

        this._mapEntry_ = node;
    }

    @Override
    public String toString()
    {
        return ""
            + toString(this._comma_)
            + toString(this._mapEntry_);
    }

    @Override
    void removeChild(@SuppressWarnings("unused") Node child)
    {
        // Remove child
        if(this._comma_ == child)
        {
            this._comma_ = null;
            return;
        }

        if(this._mapEntry_ == child)
        {
            this._mapEntry_ = null;
            return;
        }

        throw new RuntimeException("Not a child.");
    }

    @Override
    void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
    {
        // Replace child
        if(this._comma_ == oldChild)
        {
            setComma((TComma) newChild);
            return;
        }

        if(this._mapEntry_ == oldChild)
        {
            setMapEntry((PMapEntry) newChild);
            return;
        }

        throw new RuntimeException("Not a child.");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy