예제 #1
0
        public void readExternal(BinaryReader in_renamed, PrototypeFactory pf)
        {
            id = (XPathQName)ExtUtil.read(in_renamed, typeof(XPathQName));
            ArrayList v = (ArrayList)ExtUtil.read(in_renamed, new ExtWrapListPoly(), pf);

            args = new XPathExpression[v.Count];
            for (int i = 0; i < args.Length; i++)
            {
                args[i] = (XPathExpression)v[i];
            }
        }
예제 #2
0
 public Boolean equals(Object o)
 {
     if (o is XPathQName)
     {
         XPathQName x = (XPathQName)o;
         return(ExtUtil.Equals(namespace_, x.namespace_) && name.Equals(x.name));
     }
     else
     {
         return(false);
     }
 }
예제 #3
0
 public override bool Equals(System.Object o)
 {
     if (o is XPathQName)
     {
         XPathQName x = (XPathQName)o;
         return(ExtUtil.equals(namespace_Renamed, x.namespace_Renamed) && name.Equals(x.name));
     }
     else
     {
         return(false);
     }
 }
예제 #4
0
        //UPGRADE_TODO: Class 'java.io.DataInputStream' was converted to 'System.IO.BinaryReader' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataInputStream'"
        public virtual void  readExternal(System.IO.BinaryReader in_Renamed, PrototypeFactory pf)
        {
            axis = ExtUtil.readInt(in_Renamed);
            test = ExtUtil.readInt(in_Renamed);

            switch (test)
            {
            case TEST_NAME:  name = (XPathQName)ExtUtil.read(in_Renamed, typeof(XPathQName)); break;

            case TEST_NAMESPACE_WILDCARD:  namespace_Renamed = ExtUtil.readString(in_Renamed); break;

            case TEST_TYPE_PROCESSING_INSTRUCTION:  literal = ((System.String)ExtUtil.read(in_Renamed, new ExtWrapNullable(typeof(System.String)))); break;
            }

            System.Collections.ArrayList v = (System.Collections.ArrayList)ExtUtil.read(in_Renamed, new ExtWrapListPoly(), pf);
            predicates = new XPathExpression[v.Count];
            for (int i = 0; i < predicates.Length; i++)
            {
                predicates[i] = (XPathExpression)v[i];
            }
        }
예제 #5
0
 public void readExternal(BinaryReader in_, PrototypeFactory pf)
 {
     id = (XPathQName)ExtUtil.read(in_, typeof(XPathQName));
 }
예제 #6
0
        }                                   //for deserialization

        public XPathVariableReference(XPathQName id)
        {
            this.id = id;
        }
예제 #7
0
 public XPathStep(int axis, XPathQName name) : this(axis, TEST_NAME)
 {
     this.name = name;
 }
예제 #8
0
        }                          //for deserialization

        public XPathFuncExpr(XPathQName id, XPathExpression[] args)
        {
            this.id   = id;
            this.args = args;
        }
예제 #9
0
        /**
         *
         */
        public Object pivot(FormInstance model, EvaluationContext evalContext, List <Object> pivots, Object sentinal)
        {
            String name = this.id.ToString();

            //for now we'll assume that all that functions do is return the composition of their components
            Object[] argVals = new Object[args.Length];


            //Identify whether this function is an identity: IE: can reflect back the pivot sentinal with no modification
            String[] identities = new String[] { "string-length" };
            Boolean  id         = false;

            foreach (String identity in identities)
            {
                if (identity.Equals(name))
                {
                    id = true;
                }
            }

            //get each argument's pivot
            for (int i = 0; i < args.Length; i++)
            {
                argVals[i] = args[i].pivot(model, evalContext, pivots, sentinal);
            }

            Boolean pivoted = false;

            //evaluate the pivots
            for (int i = 0; i < argVals.Length; ++i)
            {
                if (argVals[i] == null)
                {
                    //one of our arguments contained pivots,
                    pivoted = true;
                }
                else if (sentinal.Equals(argVals[i]))
                {
                    //one of our arguments is the sentinal, return the sentinal if possible
                    if (id)
                    {
                        return(sentinal);
                    }
                    else
                    {
                        //This function modifies the sentinal in a way that makes it impossible to capture
                        //the pivot.
                        throw new UnpivotableExpressionException();
                    }
                }
            }

            if (pivoted)
            {
                if (id)
                {
                    return(null);
                }
                else
                {
                    //This function modifies the sentinal in a way that makes it impossible to capture
                    //the pivot.
                    throw new UnpivotableExpressionException();
                }
            }

            //TODO: Inner eval here with eval'd args to improve speed
            return(eval(model, evalContext));
        }
예제 #10
0
 //UPGRADE_TODO: Class 'java.io.DataInputStream' was converted to 'System.IO.BinaryReader' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataInputStream'"
 public override void  readExternal(System.IO.BinaryReader in_Renamed, PrototypeFactory pf)
 {
     id = (XPathQName)ExtUtil.read(in_Renamed, typeof(XPathQName));
 }