Changeset 9854 in josm for trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java
- Timestamp:
- 2016-02-23T02:11:42+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java
r9243 r9854 7 7 import java.util.Iterator; 8 8 import java.util.List; 9 import java.util.NoSuchElementException; 9 10 10 11 import org.openstreetmap.josm.Main; … … 475 476 } 476 477 478 /** 479 * Converts to list. 480 * @return elements as list 481 */ 477 482 public List<T> toList() { 478 483 List<T> a = new ArrayList<>(); … … 498 503 private int iteratedOver; 499 504 500 final QBLevel<T> next _content_node(QBLevel<T> q) {505 final QBLevel<T> nextContentNode(QBLevel<T> q) { 501 506 if (q == null) 502 507 return null; … … 514 519 currentNode = qb.root; 515 520 } else { 516 currentNode = next _content_node(qb.root);521 currentNode = nextContentNode(qb.root); 517 522 } 518 523 iteratedOver = 0; … … 531 536 while ((currentNode.content == null) || (contentIndex >= currentNode.content.size())) { 532 537 contentIndex = 0; 533 currentNode = next _content_node(currentNode);538 currentNode = nextContentNode(currentNode); 534 539 if (currentNode == null) { 535 540 break; … … 544 549 public T next() { 545 550 T ret = peek(); 551 if (ret == null) 552 throw new NoSuchElementException(); 546 553 contentIndex++; 547 554 iteratedOver++; … … 576 583 } 577 584 578 public List<T> search(BBox search _bbox) {585 public List<T> search(BBox searchBbox) { 579 586 List<T> ret = new ArrayList<>(); 580 587 // Doing this cuts down search cost on a real-life data set by about 25% … … 583 590 } 584 591 // Walk back up the tree when the last search spot can not cover the current search 585 while (searchCache != null && !searchCache.bbox().bounds(search _bbox)) {592 while (searchCache != null && !searchCache.bbox().bounds(searchBbox)) { 586 593 searchCache = searchCache.parent; 587 594 } … … 589 596 if (searchCache == null) { 590 597 searchCache = root; 591 Main.info("bbox: " + search _bbox + " is out of the world");598 Main.info("bbox: " + searchBbox + " is out of the world"); 592 599 } 593 600 … … 595 602 QBLevel<T> tmp = searchCache.parent; 596 603 597 searchCache.search(search _bbox, ret);604 searchCache.search(searchBbox, ret); 598 605 599 606 // A way that spans this bucket may be stored in one 600 607 // of the nodes which is a parent of the search cache 601 608 while (tmp != null) { 602 tmp.search_contents(search _bbox, ret);609 tmp.search_contents(searchBbox, ret); 603 610 tmp = tmp.parent; 604 611 }
Note:
See TracChangeset
for help on using the changeset viewer.