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

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

        protected DoubleParseOperation()
        {
        }

        #region IObjectOperation Members

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

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

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

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

        #endregion

        #region IOperationAcceptor Members

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

        #endregion
}
}
