Ejemplo n.º 1
0
 /** @param level -1 to get items */
 private void boundablesAtLevel(int level, AbstractNode top, Collection boundables) {
   Assert.isTrue(level > -2);
   if (top.getLevel() == level) {
     boundables.add(top);
     return;
   }
   for (Iterator i = top.getChildBoundables().iterator(); i.hasNext(); ) {
     Boundable boundable = (Boundable) i.next();
     if (boundable instanceof AbstractNode) {
       boundablesAtLevel(level, (AbstractNode) boundable, boundables);
     } else {
       Assert.isTrue(boundable instanceof ItemBoundable);
       if (level == -1) {
         boundables.add(boundable);
       }
     }
   }
   return;
 }