コード例 #1
0
  public int compute(IRectangle query) {
    System.gc();
    then = System.currentTimeMillis();
    // convert into a hypercube for processing.
    Hypercube hc =
        new Hypercube(
            new double[] {query.getLeft(), query.getBottom()},
            new double[] {query.getRight(), query.getTop()});

    model.deselectAll();
    CounterKDTree ct =
        new CounterKDTree() {

          /** Mark as being drained. */
          public void drain(DimensionalNode node) {
            super.drain(node);
            ((SelectableMultiPoint) node.point).select(1);
          }

          /** Mark as routine selection. */
          public void visit(DimensionalNode node) {
            super.visit(node);
            ((SelectableMultiPoint) node.point).select(true);
          }
        };

    tree.range(hc, ct);
    now = System.currentTimeMillis();
    return ct.getCount();
  }