Package net.sf.jsi

Examples of net.sf.jsi.PriorityQueue


    //
    // Uses a priority queue as the underlying data structure.
    //
    // Note that more than N items will be returned if items N and N+x have the
    // same priority.
    PriorityQueue distanceQueue = new PriorityQueue(PriorityQueue.SORT_ORDER_DESCENDING);
    createNearestNDistanceQueue(p, count, distanceQueue, furthestDistance);

    while (distanceQueue.size() > 0) {
      v.execute(distanceQueue.getValue());
      distanceQueue.pop();
    }
  }
View Full Code Here


  /**
   * @see net.sf.jsi.SpatialIndex#nearestN(Point, TIntProcedure, int, float)
   */
  public void nearestN(Point p, TIntProcedure v, int count, float furthestDistance) {
    PriorityQueue distanceQueue = new PriorityQueue(PriorityQueue.SORT_ORDER_DESCENDING);
    createNearestNDistanceQueue(p, count, distanceQueue, furthestDistance);
    distanceQueue.setSortOrder(PriorityQueue.SORT_ORDER_ASCENDING);

    while (distanceQueue.size() > 0) {
      v.execute(distanceQueue.getValue());
      distanceQueue.pop();
    }
  }
View Full Code Here

TOP

Related Classes of net.sf.jsi.PriorityQueue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.