protected List<DoubleObjPair<RdKNNEntry>> getSortedEntries(AbstractRStarTreeNode<?, ?> node, SpatialComparable q, SpatialPrimitiveDistanceFunction<?> distanceFunction) {
    List<DoubleObjPair<RdKNNEntry>> result = new ArrayList<>();
    for(int i = 0; i < node.getNumEntries(); i++) {
      RdKNNEntry entry = (RdKNNEntry) node.getEntry(i);
      double minDist = distanceFunction.minDist(entry, q);
      result.add(new DoubleObjPair<>(minDist, entry));
    }
    Collections.sort(result);
    return result;
  }
protected List<DoubleObjPair<RdKNNEntry>> getSortedEntries(AbstractRStarTreeNode<?, ?> node, SpatialComparable q, SpatialPrimitiveDistanceFunction<?> distanceFunction) {
    List<DoubleObjPair<RdKNNEntry>> result = new ArrayList<>();
    for(int i = 0; i < node.getNumEntries(); i++) {
      RdKNNEntry entry = (RdKNNEntry) node.getEntry(i);
      double minDist = distanceFunction.minDist(entry, q);
      result.add(new DoubleObjPair<>(minDist, entry));
    }
    Collections.sort(result);
    return result;
  }
protected list<doubleobjpair<rdknnentry>> getsortedentries(abstractrstartreenode<?, ?> node, spatialcomparable q, spatialprimitivedistancefunction<?> distancefunction) { list<doubleobjpair<rdknnentry>> result = new arraylist<>(); for(int i = 0; i < node.getnumentries(); i++) { rdknnentry entry = (rdknnentry) node.getentry(i); double mindist = distancefunction.mindist(entry, q); result.add(new doubleobjpair<>(mindist, entry)); } collections.sort(result); return result; }