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

package se.sics.kola.node;

import se.sics.kola.analysis.*;

@SuppressWarnings("nls")
public final class AInterfaceTypeDeclaration extends PTypeDeclaration
{
    private PInterfaceDeclaration _interfaceDeclaration_;

    public AInterfaceTypeDeclaration()
    {
        // Constructor
    }

    public AInterfaceTypeDeclaration(
        @SuppressWarnings("hiding") PInterfaceDeclaration _interfaceDeclaration_)
    {
        // Constructor
        setInterfaceDeclaration(_interfaceDeclaration_);

    }

    @Override
    public Object clone()
    {
        return new AInterfaceTypeDeclaration(
            cloneNode(this._interfaceDeclaration_));
    }

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

    public PInterfaceDeclaration getInterfaceDeclaration()
    {
        return this._interfaceDeclaration_;
    }

    public void setInterfaceDeclaration(PInterfaceDeclaration node)
    {
        if(this._interfaceDeclaration_ != null)
        {
            this._interfaceDeclaration_.parent(null);
        }

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

            node.parent(this);
        }

        this._interfaceDeclaration_ = node;
    }

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

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

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

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

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