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

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

There is a newer version: 4.2.2
Show 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 AMapVar extends PMapVar
{
    private TLCurl _start_;
    private TId _var_;
    private TRCurl _end_;

    public AMapVar()
    {
        // Constructor
    }

    public AMapVar(
        @SuppressWarnings("hiding") TLCurl _start_,
        @SuppressWarnings("hiding") TId _var_,
        @SuppressWarnings("hiding") TRCurl _end_)
    {
        // Constructor
        setStart(_start_);

        setVar(_var_);

        setEnd(_end_);

    }

    @Override
    public Object clone()
    {
        return new AMapVar(
            cloneNode(this._start_),
            cloneNode(this._var_),
            cloneNode(this._end_));
    }

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

    public TLCurl getStart()
    {
        return this._start_;
    }

    public void setStart(TLCurl node)
    {
        if(this._start_ != null)
        {
            this._start_.parent(null);
        }

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

            node.parent(this);
        }

        this._start_ = node;
    }

    public TId getVar()
    {
        return this._var_;
    }

    public void setVar(TId node)
    {
        if(this._var_ != null)
        {
            this._var_.parent(null);
        }

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

            node.parent(this);
        }

        this._var_ = node;
    }

    public TRCurl getEnd()
    {
        return this._end_;
    }

    public void setEnd(TRCurl node)
    {
        if(this._end_ != null)
        {
            this._end_.parent(null);
        }

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

            node.parent(this);
        }

        this._end_ = node;
    }

    @Override
    public String toString()
    {
        return ""
            + toString(this._start_)
            + toString(this._var_)
            + toString(this._end_);
    }

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

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

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

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

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

        if(this._var_ == oldChild)
        {
            setVar((TId) newChild);
            return;
        }

        if(this._end_ == oldChild)
        {
            setEnd((TRCurl) newChild);
            return;
        }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy