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

package uk.co.zonetora.fj.ast.node;

import uk.co.zonetora.fj.ast.analysis.*;

public final class X2PMethodDecl extends XPMethodDecl
{
    private PMethodDecl _pMethodDecl_;

    public X2PMethodDecl()
    {
    }

    public X2PMethodDecl(
        PMethodDecl _pMethodDecl_)
    {
        setPMethodDecl(_pMethodDecl_);
    }

    public Object clone()
    {
        throw new RuntimeException("Unsupported Operation");
    }

    public void apply(Switch sw)
    {
        throw new RuntimeException("Switch not supported.");
    }

    public PMethodDecl getPMethodDecl()
    {
        return _pMethodDecl_;
    }

    public void setPMethodDecl(PMethodDecl node)
    {
        if(_pMethodDecl_ != null)
        {
            _pMethodDecl_.parent(null);
        }

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

            node.parent(this);
        }

        _pMethodDecl_ = node;
    }

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

    void replaceChild(Node oldChild, Node newChild)
    {
    }

    public String toString()
    {
        return "" +
            toString(_pMethodDecl_);
    }
}
