Exemplo n.º 1
0
        /// <summary>Returns true iff <code>o</code> is equal to this. </summary>
        public override bool Equals(System.Object o)
        {
            if (this == o)
            {
                return(true);
            }
            if (!(o is SpanNearQuery))
            {
                return(false);
            }

            SpanNearQuery spanNearQuery = (SpanNearQuery)o;

            if (inOrder != spanNearQuery.inOrder)
            {
                return(false);
            }
            if (slop != spanNearQuery.slop)
            {
                return(false);
            }
            if (clauses.Count != spanNearQuery.clauses.Count)
            {
                return(false);
            }
            IEnumerator <SpanQuery> iter1 = clauses.GetEnumerator();
            IEnumerator <SpanQuery> iter2 = spanNearQuery.clauses.GetEnumerator();

            while (iter1.MoveNext() && iter2.MoveNext())
            {
                SpanQuery item1 = iter1.Current;
                SpanQuery item2 = iter2.Current;
                if (!item1.Equals(item2))
                {
                    return(false);
                }
            }

            return(GetBoost() == spanNearQuery.GetBoost());
        }
Exemplo n.º 2
0
        /// <summary>Returns true iff <c>o</c> is equal to this. </summary>
        public override bool Equals(System.Object o)
        {
            if (this == o)
            {
                return(true);
            }
            if (!(o is SpanNearQuery))
            {
                return(false);
            }

            SpanNearQuery spanNearQuery = (SpanNearQuery)o;

            if (inOrder != spanNearQuery.inOrder)
            {
                return(false);
            }
            if (internalSlop != spanNearQuery.internalSlop)
            {
                return(false);
            }
            if (clauses.Count != spanNearQuery.clauses.Count)
            {
                return(false);
            }
            System.Collections.IEnumerator iter1 = clauses.GetEnumerator();
            System.Collections.IEnumerator iter2 = spanNearQuery.clauses.GetEnumerator();
            while (iter1.MoveNext() && iter2.MoveNext())
            {
                SpanQuery item1 = (SpanQuery)iter1.Current;
                SpanQuery item2 = (SpanQuery)iter2.Current;
                if (!item1.Equals(item2))
                {
                    return(false);
                }
            }

            return(Boost == spanNearQuery.Boost);
        }