Changeset 6674 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2014-01-12T10:41:20+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r6429 r6674 22 22 import org.openstreetmap.josm.data.osm.Node; 23 23 import org.openstreetmap.josm.data.osm.OsmPrimitive; 24 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 24 25 import org.openstreetmap.josm.data.osm.OsmUtils; 25 26 import org.openstreetmap.josm.data.osm.Relation; … … 746 747 } 747 748 748 // TODO: change how we handle this749 749 private static class ExactType extends Match { 750 private final Class<?>type;750 private final OsmPrimitiveType type; 751 751 public ExactType(String type) throws ParseError { 752 if ("node".equals(type)) { 753 this.type = Node.class; 754 } else if ("way".equals(type)) { 755 this.type = Way.class; 756 } else if ("relation".equals(type)) { 757 this.type = Relation.class; 758 } else 752 this.type = OsmPrimitiveType.from(type); 753 if (this.type == null) 759 754 throw new ParseError(tr("Unknown primitive type: {0}. Allowed values are node, way or relation", 760 755 type)); 761 756 } 762 757 @Override public boolean match(OsmPrimitive osm) { 763 return osm.getClass() == type;758 return type.equals(osm.getType()); 764 759 } 765 760 @Override public String toString() {return "type="+type;}
Note:
See TracChangeset
for help on using the changeset viewer.