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

package org.acre.lang.node;

import java.util.*;
import org.acre.lang.analysis.*;

public final class AIntersectionMultiplicativeExpr extends PMultiplicativeExpr
{
    private PMultiplicativeExpr _multiplicativeExpr_;
    private TSetAnd _setAnd_;
    private PTmpInExpr _tmpInExpr_;

    public AIntersectionMultiplicativeExpr()
    {
    }

    public AIntersectionMultiplicativeExpr(
        PMultiplicativeExpr _multiplicativeExpr_,
        TSetAnd _setAnd_,
        PTmpInExpr _tmpInExpr_)
    {
        setMultiplicativeExpr(_multiplicativeExpr_);

        setSetAnd(_setAnd_);

        setTmpInExpr(_tmpInExpr_);

    }
    public Object clone()
    {
        return new AIntersectionMultiplicativeExpr(
            (PMultiplicativeExpr) cloneNode(_multiplicativeExpr_),
            (TSetAnd) cloneNode(_setAnd_),
            (PTmpInExpr) cloneNode(_tmpInExpr_));
    }

    public void apply(Switch sw)
    {
        ((Analysis) sw).caseAIntersectionMultiplicativeExpr(this);
    }

    public PMultiplicativeExpr getMultiplicativeExpr()
    {
        return _multiplicativeExpr_;
    }

    public void setMultiplicativeExpr(PMultiplicativeExpr node)
    {
        if(_multiplicativeExpr_ != null)
        {
            _multiplicativeExpr_.parent(null);
        }

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

            node.parent(this);
        }

        _multiplicativeExpr_ = node;
    }

    public TSetAnd getSetAnd()
    {
        return _setAnd_;
    }

    public void setSetAnd(TSetAnd node)
    {
        if(_setAnd_ != null)
        {
            _setAnd_.parent(null);
        }

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

            node.parent(this);
        }

        _setAnd_ = node;
    }

    public PTmpInExpr getTmpInExpr()
    {
        return _tmpInExpr_;
    }

    public void setTmpInExpr(PTmpInExpr node)
    {
        if(_tmpInExpr_ != null)
        {
            _tmpInExpr_.parent(null);
        }

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

            node.parent(this);
        }

        _tmpInExpr_ = node;
    }

    public String toString()
    {
        return ""
            + toString(_multiplicativeExpr_)
            + toString(_setAnd_)
            + toString(_tmpInExpr_);
    }

    void removeChild(Node child)
    {
        if(_multiplicativeExpr_ == child)
        {
            _multiplicativeExpr_ = null;
            return;
        }

        if(_setAnd_ == child)
        {
            _setAnd_ = null;
            return;
        }

        if(_tmpInExpr_ == child)
        {
            _tmpInExpr_ = null;
            return;
        }

    }

    void replaceChild(Node oldChild, Node newChild)
    {
        if(_multiplicativeExpr_ == oldChild)
        {
            setMultiplicativeExpr((PMultiplicativeExpr) newChild);
            return;
        }

        if(_setAnd_ == oldChild)
        {
            setSetAnd((TSetAnd) newChild);
            return;
        }

        if(_tmpInExpr_ == oldChild)
        {
            setTmpInExpr((PTmpInExpr) newChild);
            return;
        }

    }
}
