- Timestamp:
- 2009-11-09T09:08:05+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java
r2388 r2420 2 2 import java.lang.reflect.Array; 3 3 import java.util.ArrayList; 4 import java.util.Arrays; 4 5 import java.util.Collection; 5 6 import java.util.Collections; … … 20 21 static void abort(String s) 21 22 { 22 out(s); 23 Object o = null; 24 o.hashCode(); 23 throw new AssertionError(s); 25 24 } 26 25 static void out(String s) … … 82 81 (xmax > 180.0) || 83 82 (ymin < -90.0) || 84 (ymax > 90.0)) { 85 out("bad BBox: " + this); 86 Object o = null; 87 o.hashCode(); 88 } 83 (ymax > 90.0)) 84 throw new IllegalArgumentException("bad BBox: " + this); 89 85 } 90 86 @Override … … 253 249 return ret; 254 250 } 255 @SuppressWarnings("unchecked")256 251 QBLevel[] newChildren() 257 252 { … … 272 267 } 273 268 if (o instanceof Node) { 274 Node n = (Node)o;275 269 LatLon coor = ((Node)o).getCoor(); 276 270 if (coor == null) … … 365 359 void add_to_leaf(T o) 366 360 { 367 QBLevel ret = this;368 361 add_content(o); 369 362 if (content.size() > MAX_OBJECTS_PER_LEVEL) { … … 545 538 if (content == null) { 546 539 if (debug) { 547 out("["+level+"] leaf size: null content, children? " + children);540 out("["+level+"] leaf size: null content, children? " + Arrays.toString(children)); 548 541 } 549 542 return 0; … … 580 573 QBLevel find_exact(T n) 581 574 { 582 QBLevel ret = null;583 575 if (content != null && content.contains(n)) 584 576 return this; … … 855 847 throw new UnsupportedOperationException(); 856 848 } 857 public boolean retainAll(Collection objects)849 public boolean retainAll(Collection<?> objects) 858 850 { 859 851 for (T o : this) { … … 874 866 return false; 875 867 } 876 public boolean removeAll(Collection objects)868 public boolean removeAll(Collection<?> objects) 877 869 { 878 870 for (Object o : objects) { … … 884 876 return true; 885 877 } 886 public boolean addAll(Collection objects)878 public boolean addAll(Collection<? extends T> objects) 887 879 { 888 880 for (Object o : objects) { … … 894 886 return true; 895 887 } 896 public boolean containsAll(Collection objects) 897 { 898 boolean ret = true; 888 public boolean containsAll(Collection<?> objects) 889 { 899 890 for (Object o : objects) { 900 891 if (!canStore(o)) … … 987 978 return this.toArrayList().toArray(); 988 979 } 989 public < T> T[] toArray(T[] template)980 public <A> A[] toArray(A[] template) 990 981 { 991 982 return this.toArrayList().toArray(template); … … 1082 1073 // an element 1083 1074 content_index--; 1084 T object = peek();1075 peek(); //TODO Is the call to peek() necessary? 1085 1076 current_node.content.remove(content_index); 1086 1077 } … … 1196 1187 tmp = tmp.parent; 1197 1188 } 1198 if (ret == null || ret.size() == 0)1199 return Collections.emptyList();1200 1189 if (debug) { 1201 1190 out("search of QuadBuckets for " + search_bbox + " ret len: " + ret.size());
Note:
See TracChangeset
for help on using the changeset viewer.