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

package soot.jimple.parser.node;

import soot.jimple.parser.analysis.*;

@SuppressWarnings("nls")
public final class AUnknownJimpleType extends PJimpleType
{
    private TUnknown _unknown_;

    public AUnknownJimpleType()
    {
        // Constructor
    }

    public AUnknownJimpleType(
        @SuppressWarnings("hiding") TUnknown _unknown_)
    {
        // Constructor
        setUnknown(_unknown_);

    }

    @Override
    public Object clone()
    {
        return new AUnknownJimpleType(
            cloneNode(this._unknown_));
    }

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

    public TUnknown getUnknown()
    {
        return this._unknown_;
    }

    public void setUnknown(TUnknown node)
    {
        if(this._unknown_ != null)
        {
            this._unknown_.parent(null);
        }

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

            node.parent(this);
        }

        this._unknown_ = node;
    }

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

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

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

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

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