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

package com.abstratt.mdd.frontend.textuml.grammar.node;

import com.abstratt.mdd.frontend.textuml.grammar.analysis.*;

@SuppressWarnings("nls")
public final class AOperationOperationKeyword extends POperationKeyword
{
    private TOperation _operation_;

    public AOperationOperationKeyword()
    {
        // Constructor
    }

    public AOperationOperationKeyword(
        @SuppressWarnings("hiding") TOperation _operation_)
    {
        // Constructor
        setOperation(_operation_);

    }

    @Override
    public Object clone()
    {
        return new AOperationOperationKeyword(
            cloneNode(this._operation_));
    }

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

    public TOperation getOperation()
    {
        return this._operation_;
    }

    public void setOperation(TOperation node)
    {
        if(this._operation_ != null)
        {
            this._operation_.parent(null);
        }

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

            node.parent(this);
        }

        this._operation_ = node;
    }

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

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

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

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

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