using System;
using System.Collections.Generic;
using System.Text;

namespace FormulaEditor
{
    public class Int32ParseOperation : IObjectOperation, IOperationAcceptor
    {
        static public readonly Int32ParseOperation Object = new Int32ParseOperation();

        protected Int32ParseOperation()
        {
        }


        #region IObjectOperation Members

        int IObjectOperation.Arity
        {
            get { return 1; }
        }

        object IObjectOperation.this[object[] x]
        {
            get { return Int32.Parse(x[0] + ""); }
        }

        object IObjectOperation.ReturnType
        {
            get { return ElementaryBinaryOperation.Int32Type; }
        }

        bool IObjectOperation.IsPowered
        {
            get { return true; }
        }

        #endregion

        #region IOperationAcceptor Members

        IObjectOperation IOperationAcceptor.Accept(object type)
        {
            return this;
        }

        #endregion
}
}
