Beispiel #1
0
 /** Removes an item from the tree. (Builds the tree, if necessary.) */
 protected boolean remove(Object searchBounds, Object item) {
   build();
   if (itemBoundables.isEmpty()) {
     Assert.isTrue(root.getBounds() == null);
   }
   if (getIntersectsOp().intersects(root.getBounds(), searchBounds)) {
     return remove(searchBounds, root, item);
   }
   return false;
 }
 /** Removes an item from the tree. (Builds the tree, if necessary.) */
 protected boolean remove(Object searchBounds, Object item) {
   build();
   if (getIntersectsOp().intersects(root.getBounds(), searchBounds)) {
     return remove(searchBounds, root, item);
   }
   return false;
 }
 /** Also builds the tree, if necessary. */
 protected void query(Object searchBounds, ItemVisitor visitor) {
   build();
   if (isEmpty()) {
     // nothing in tree, so return
     // Assert.isTrue(root.getBounds() == null);
     return;
   }
   if (getIntersectsOp().intersects(root.getBounds(), searchBounds)) {
     query(searchBounds, root, visitor);
   }
 }
 /** Also builds the tree, if necessary. */
 protected List query(Object searchBounds) {
   build();
   ArrayList matches = new ArrayList();
   if (isEmpty()) {
     // Assert.isTrue(root.getBounds() == null);
     return matches;
   }
   if (getIntersectsOp().intersects(root.getBounds(), searchBounds)) {
     query(searchBounds, root, matches);
   }
   return matches;
 }