public override Boolean Equals(Object o)
 {
     if (o is XPathVariableReference)
     {
         XPathVariableReference x = (XPathVariableReference)o;
         return(id.equals(x.id));
     }
     else
     {
         return(false);
     }
 }
Exemple #2
0
        public Boolean Equals(Object o)
        {
            if (o is XPathStep)
            {
                XPathStep x = (XPathStep)o;

                //shortcuts for faster evaluation
                if (axis != x.axis && test != x.test || predicates.Length != x.predicates.Length)
                {
                    return(false);
                }

                switch (test)
                {
                case TEST_NAME: if (!name.equals(x.name))
                    {
                        return(false);
                    }
                    break;

                case TEST_NAMESPACE_WILDCARD: if (!namespace_.Equals(x.namespace_))
                    {
                        return(false);
                    }
                    break;

                case TEST_TYPE_PROCESSING_INSTRUCTION: if (!ExtUtil.Equals(literal, x.literal))
                    {
                        return(false);
                    }
                    break;

                default: break;
                }

                return(ExtUtil.arrayEquals(predicates, x.predicates));
            }
            else
            {
                return(false);
            }
        }