Exemple #1
0
        public Boolean equals(Object o)
        {
            if (o is XPathPathExpr)
            {
                XPathPathExpr x = (XPathPathExpr)o;

                //Shortcuts for easily comparable values
                if (init_context != x.init_context || steps.Length != x.steps.Length)
                {
                    return(false);
                }

                return(ExtUtil.arrayEquals(steps, x.steps) && (init_context == INIT_CONTEXT_EXPR ? filtExpr.equals(x.filtExpr) : true));
            }
            else
            {
                return(false);
            }
        }
Exemple #2
0
        public Boolean Equals(Object o)
        {
            if (o is XPathFuncExpr)
            {
                XPathFuncExpr x = (XPathFuncExpr)o;

                //Shortcuts for very easily comprable values
                if (!id.Equals(x.id) || args.Length != x.args.Length)
                {
                    return(false);
                }

                return(ExtUtil.arrayEquals(args, x.args));
            }
            else
            {
                return(false);
            }
        }
Exemple #3
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);
            }
        }