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

prerna.sablecc.node.AColWhere 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.sablecc.node;

import prerna.sablecc.analysis.*;

@SuppressWarnings("nls")
public final class AColWhere extends PColWhere
{
    private PColDef _colDef_;
    private PEqualOrCompare _equalOrCompare_;
    private PTerm _term_;

    public AColWhere()
    {
        // Constructor
    }

    public AColWhere(
        @SuppressWarnings("hiding") PColDef _colDef_,
        @SuppressWarnings("hiding") PEqualOrCompare _equalOrCompare_,
        @SuppressWarnings("hiding") PTerm _term_)
    {
        // Constructor
        setColDef(_colDef_);

        setEqualOrCompare(_equalOrCompare_);

        setTerm(_term_);

    }

    @Override
    public Object clone()
    {
        return new AColWhere(
            cloneNode(this._colDef_),
            cloneNode(this._equalOrCompare_),
            cloneNode(this._term_));
    }

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

    public PColDef getColDef()
    {
        return this._colDef_;
    }

    public void setColDef(PColDef node)
    {
        if(this._colDef_ != null)
        {
            this._colDef_.parent(null);
        }

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

            node.parent(this);
        }

        this._colDef_ = node;
    }

    public PEqualOrCompare getEqualOrCompare()
    {
        return this._equalOrCompare_;
    }

    public void setEqualOrCompare(PEqualOrCompare node)
    {
        if(this._equalOrCompare_ != null)
        {
            this._equalOrCompare_.parent(null);
        }

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

            node.parent(this);
        }

        this._equalOrCompare_ = node;
    }

    public PTerm getTerm()
    {
        return this._term_;
    }

    public void setTerm(PTerm node)
    {
        if(this._term_ != null)
        {
            this._term_.parent(null);
        }

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

            node.parent(this);
        }

        this._term_ = node;
    }

    @Override
    public String toString()
    {
        return ""
            + toString(this._colDef_)
            + toString(this._equalOrCompare_)
            + toString(this._term_);
    }

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

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

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

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

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

        if(this._equalOrCompare_ == oldChild)
        {
            setEqualOrCompare((PEqualOrCompare) newChild);
            return;
        }

        if(this._term_ == oldChild)
        {
            setTerm((PTerm) newChild);
            return;
        }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy