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

namespace FormulaEditor
{
    internal class DateTimeMoreComparator : IObjectOperation, IBinaryAcceptor
    {
        static private readonly Boolean b = false;

        static public readonly DateTimeMoreComparator Object =
            new DateTimeMoreComparator();

        protected DateTimeMoreComparator()
        {
        }
        #region IObjectOperation Members

        public int Arity
        {
            get { return 2; }
        }

        public virtual object this[object[] x]
        {
            get
            {
                DateTime dt0 = (DateTime)x[0];
                DateTime dt1 = (DateTime)x[1];
                return dt0 > dt1;
            }
        }

        public object ReturnType
        {
            get { return b; }
        }

        public bool IsPowered
        {
            get { return false; }
        }

        #endregion


        #region IBinaryAcceptor Members

        public IObjectOperation Accept(object typeA, object typeB)
        {
            if (typeA.Equals(DateTimeSymbol.Object) & typeB.Equals(DateTimeSymbol.Object))
            {
                return this;
            }
            return null;
        }

        #endregion
}
}