Example #1
0
 protected void cacheDescendantsHelper(Node n) {
   for (Node child : n.getChildNodes()) {
     if (descendants.contains(child)) {
       continue;
     }
     descendants.add(child);
     cacheDescendantsHelper(child);
   }
 }
Example #2
0
 protected void cacheDescendants() {
   descendants = new HashSet<Node>();
   cacheDescendantsHelper(this);
 }