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

namespace FormulaEditor
{
    /// <summary>
    /// String operation acceptor
    /// </summary>
    public class StringOperationAcceptor : IObjectOperation, IOperationAcceptor
    {

        #region Fields

        private static readonly string typeOp = "";

        private string str;

        #endregion

        #region Constructors

        public StringOperationAcceptor(string str)
        {
            if (str != null)
            {
                this.str = str + "";
            }
        }

        #endregion

        #region IObjectOperation Members



        public int Arity
        {
            get
            {
                return 0;
            }
        }

        public object this[object[] x]
        {
            get
            {
                return str;
            }
        }

        public object ReturnType
        {
            get
            {
                return typeOp;
            }
        }

        public bool IsPowered
        {
            get
            {
                return false;
            }
        }

        #endregion

        #region IOperationAcceptor Members

        public IObjectOperation Accept(object type)
        {
            if (typeOp.Equals(type))
            {
                return this;
            }
            return this;
        }

        #endregion
    }
}
