Changeset 2025 in josm for trunk/src/org/openstreetmap/josm/actions/search
- Timestamp:
- 2009-09-02T21:17:52+02:00 (17 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions/search
- Files:
-
- 2 edited
-
SearchCompiler.java (modified) (2 diffs)
-
SelectionWebsiteLoader.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r1938 r2025 227 227 228 228 switch (mode) { 229 case NONE: 230 return false; 231 case MISSING_KEY: 232 return osm.get(key) == null; 233 case ANY: 234 return true; 235 case ANY_VALUE: 236 return osm.get(key) != null; 237 case ANY_KEY: 238 for (String v:osm.getKeys().values()) { 239 if (v.equals(value)) 240 return true; 241 } 242 return false; 243 case EXACT: 244 return value.equals(osm.get(key)); 245 case ANY_KEY_REGEXP: 246 for (String v:osm.getKeys().values()) { 247 if (valuePattern.matcher(v).matches()) 248 return true; 249 } 250 return false; 251 case ANY_VALUE_REGEXP: 252 case EXACT_REGEXP: 253 for (Entry<String, String> entry:osm.entrySet()) { 254 if (keyPattern.matcher(entry.getKey()).matches()) { 255 if (mode == Mode.ANY_VALUE_REGEXP 256 || valuePattern.matcher(entry.getValue()).matches()) 229 case NONE: 230 return false; 231 case MISSING_KEY: 232 return osm.get(key) == null; 233 case ANY: 234 return true; 235 case ANY_VALUE: 236 return osm.get(key) != null; 237 case ANY_KEY: 238 for (String v:osm.getKeys().values()) { 239 if (v.equals(value)) 257 240 return true; 258 241 } 259 } 260 return false; 261 case MISSING_KEY_REGEXP: 262 for (String k:osm.keySet()) { 263 if (keyPattern.matcher(k).matches()) 264 return false; 265 } 266 return true; 242 return false; 243 case EXACT: 244 return value.equals(osm.get(key)); 245 case ANY_KEY_REGEXP: 246 for (String v:osm.getKeys().values()) { 247 if (valuePattern.matcher(v).matches()) 248 return true; 249 } 250 return false; 251 case ANY_VALUE_REGEXP: 252 case EXACT_REGEXP: 253 for (Entry<String, String> entry:osm.entrySet()) { 254 if (keyPattern.matcher(entry.getKey()).matches()) { 255 if (mode == Mode.ANY_VALUE_REGEXP 256 || valuePattern.matcher(entry.getValue()).matches()) 257 return true; 258 } 259 } 260 return false; 261 case MISSING_KEY_REGEXP: 262 for (String k:osm.keySet()) { 263 if (keyPattern.matcher(k).matches()) 264 return false; 265 } 266 return true; 267 267 } 268 268 throw new AssertionError("Missed state"); … … 402 402 private static class Modified extends Match { 403 403 @Override public boolean match(OsmPrimitive osm) { 404 return osm. modified|| osm.id== 0;404 return osm.isModified() || osm.getId() == 0; 405 405 } 406 406 @Override public String toString() {return "modified";} -
trunk/src/org/openstreetmap/josm/actions/search/SelectionWebsiteLoader.java
r2017 r2025 48 48 Map<Long, String> ids = idReader.parseIds(in); 49 49 for (OsmPrimitive osm : Main.main.getCurrentDataSet().allNonDeletedPrimitives()) { 50 if (ids.containsKey(osm. id) && osm.getClass().getName().toLowerCase().endsWith(ids.get(osm.id))) {50 if (ids.containsKey(osm.getId()) && osm.getClass().getName().toLowerCase().endsWith(ids.get(osm.getId()))) { 51 51 if (mode == SearchAction.SearchMode.remove) { 52 52 sel.remove(osm);
Note:
See TracChangeset
for help on using the changeset viewer.
