/* 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 AFloatConstant extends PConstant
{
    private TMinus _minus_;
    private TFloatConstant _floatConstant_;

    public AFloatConstant()
    {
        // Constructor
    }

    public AFloatConstant(
        @SuppressWarnings("hiding") TMinus _minus_,
        @SuppressWarnings("hiding") TFloatConstant _floatConstant_)
    {
        // Constructor
        setMinus(_minus_);

        setFloatConstant(_floatConstant_);

    }

    @Override
    public Object clone()
    {
        return new AFloatConstant(
            cloneNode(this._minus_),
            cloneNode(this._floatConstant_));
    }

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

    public TMinus getMinus()
    {
        return this._minus_;
    }

    public void setMinus(TMinus node)
    {
        if(this._minus_ != null)
        {
            this._minus_.parent(null);
        }

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

            node.parent(this);
        }

        this._minus_ = node;
    }

    public TFloatConstant getFloatConstant()
    {
        return this._floatConstant_;
    }

    public void setFloatConstant(TFloatConstant node)
    {
        if(this._floatConstant_ != null)
        {
            this._floatConstant_.parent(null);
        }

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

            node.parent(this);
        }

        this._floatConstant_ = node;
    }

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

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

        if(this._floatConstant_ == child)
        {
            this._floatConstant_ = null;
            return;
        }

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

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

        if(this._floatConstant_ == oldChild)
        {
            setFloatConstant((TFloatConstant) newChild);
            return;
        }

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