[jdom-interest] Element.hasMixedContent() method

Kevin Regan kevinr at valicert.com
Fri Jun 2 12:29:13 PDT 2000


Could this be implemented a good deal more efficiently
and simply:


Class prevClass = null;
Iterator i = content.iterator();
while (i.hasNext()) {
    Object obj = i.next();
    Class newClass = obj.getClass();

    if (newClass != prevClass) {
       if (prevClass != null) {
          return true;
       }
       prevClass = newClass;
    }
}

return false;




More information about the jdom-interest mailing list