Beispiel #1
0
 /**
  * Recursively searches the tree for all intersecting entries. Immediately calls execute() on the
  * passed IntProcedure when a matching entry is found.
  *
  * <p>[x] TODO rewrite this to be non-recursive? Make sure it doesn't slow it down.
  */
 private void intersects(Rectangle r, IntProcedure v, Node n) {
   for (int i = 0; i < n.entryCount; i++) {
     if (r.intersects(n.entries[i])) {
       if (n.isLeaf()) {
         v.execute(n.ids[i]);
       } else {
         Node childNode = getNode(n.ids[i]);
         intersects(r, v, childNode);
       }
     }
   }
 }
Beispiel #2
0
 /** @see com.infomatiq.jsi.SpatialIndex#intersects(Rectangle, IntProcedure) */
 public void intersects(Rectangle r, IntProcedure v) {
   Node rootNode = getNode(rootNodeId);
   intersects(r, v, rootNode);
 }