R[jdom-interest] XPath class

Andy Lord Andy_Lord at tertio.com
Fri Mar 15 04:12:36 PST 2002


>    public static XPath makeXPath(String s)  throws JDOMException {
 >       try {
 >           XPath xp = null;
 >           if (xpaths.containsKey(s))
 >               xp = (XPath)(xpaths.get(s));
 >           else {
 >               xp = new RhinoXPath(s);
 >               xpaths.put(s, xp);
 >           }
 >   return xp;
 >       }

Good idea, but wouldn't

if ((xp=(XPath)xpaths.get(s)) == null) {
     xp=new RhinoXPath(s);
     xpaths.put(s,xp);
}

save one lookup?

Whats a RhinoXPath BTW ?? Does it embed Javascript in Xpath expressions???


Lordy






More information about the jdom-interest mailing list