XPathStringVal_EndsWith() protected method

This method is called by ends-with in FuncExpression, it is to perform ends-with on concatnation of text value of an element or document without actually creating the string object.
protected XPathStringVal_EndsWith ( int j, String s ) : bool
j int
s String
return bool
Ejemplo n.º 1
0
 private bool endsWith(VTDNav vn)
 {
     String s2 = argumentList.next.e.evalString(vn);
     if (argumentList.e.NodeSet)
     {
         int a = evalFirstArgumentListNodeSet(vn);
         if (a == -1)
             return "".EndsWith(s2);
         else
         {
             try
             {
                 int t = vn.getTokenType(a);
                 if (t != VTDNav.TOKEN_STARTING_TAG && t != VTDNav.TOKEN_DOCUMENT)
                     return vn.endsWith(a, s2);
                 else
                     return vn.XPathStringVal_EndsWith(a, s2);
             }
             catch (Exception e)
             {
             }
             return false;
         }
     }
     String s1 = argumentList.e.evalString(vn);
     return s1.EndsWith(s2);
 }