- Timestamp:
- 2009-09-27T10:51:57+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java
r2165 r2197 668 668 { 669 669 out("unsupported operation"); 670 Object o = null;671 o.hashCode();672 670 throw new UnsupportedOperationException(); 673 671 } 674 672 public boolean retainAll(Collection nodes) 675 673 { 676 unsupported(); 677 return false; 674 for (Node n : this) { 675 if (nodes.contains(n)) 676 continue; 677 if (!this.remove(n)) 678 return false; 679 } 680 return true; 678 681 } 679 682 public boolean removeAll(Collection nodes) 680 683 { 681 unsupported(); 682 return false; 684 for (Object o : nodes) { 685 if (!(o instanceof Node)) 686 return false; 687 Node n = (Node)o; 688 if (!this.remove(n)) 689 return false; 690 } 691 return true; 683 692 } 684 693 public boolean addAll(Collection nodes) 685 694 { 686 unsupported(); 687 return false; 695 for (Object o : nodes) { 696 if (!(o instanceof Node)) 697 return false; 698 Node n = (Node)o; 699 if (!this.add(n)) 700 return false; 701 } 702 return true; 688 703 } 689 704 public boolean containsAll(Collection nodes) 690 705 { 691 unsupported(); 692 return false; 706 boolean ret = true; 707 for (Object o : nodes) { 708 if (!(o instanceof Node)) 709 return false; 710 Node n = (Node)o; 711 if (!this.contains(n)) 712 return false; 713 } 714 return true; 693 715 } 694 716 private void check_type(Object o) … … 712 734 public boolean contains(Object o) 713 735 { 714 check_type(o); 736 if (!(o instanceof Node)) 737 return false; 715 738 QBLevel bucket = root.find_exact((Node)o); 716 739 if (bucket == null) … … 808 831 public void remove() 809 832 { 810 Node object = peek(); 811 current_leaf.content.remove(object); 833 // two uses 834 // 1. Back up to the thing we just returned 835 // 2. move the index back since we removed 836 // an element 837 index_in_leaf--; 838 current_leaf.content.remove(index_in_leaf); 812 839 } 813 840 }
Note:
See TracChangeset
for help on using the changeset viewer.