Changeset 8198 in josm for trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
- Timestamp:
- 2015-04-15T22:31:53+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r7509 r8198 99 99 public class CoreSimpleMatchFactory implements SimpleMatchFactory { 100 100 private Collection<String> keywords = Arrays.asList("id", "version", 101 "changeset", "nodes", "tags", "areasize", " modified", "selected",101 "changeset", "nodes", "tags", "areasize", "waylength", "modified", "selected", 102 102 "incomplete", "untagged", "closed", "new", "indownloadedarea", 103 103 "allindownloadedarea", "inview", "allinview", "timestamp", "nth", "nth%"); … … 141 141 case "areasize": 142 142 return new AreaSize(tokenizer); 143 case "waylength": 144 return new WayLength(tokenizer); 143 145 case "nth": 144 146 return new Nth(tokenizer, false); … … 1115 1117 1116 1118 /** 1119 * Matches if the length of a way is within the given range 1120 */ 1121 private static class WayLength extends RangeMatch { 1122 1123 public WayLength(Range range) { 1124 super(range); 1125 } 1126 1127 public WayLength(PushbackTokenizer tokenizer) throws ParseError { 1128 this(tokenizer.readRange(tr("Range of numbers expected"))); 1129 } 1130 1131 @Override 1132 protected Long getNumber(OsmPrimitive osm) { 1133 if (!(osm instanceof Way)) 1134 return null; 1135 Way way = (Way) osm; 1136 return (long) way.getLength(); 1137 } 1138 1139 @Override 1140 protected String getString() { 1141 return "waylength"; 1142 } 1143 } 1144 1145 /** 1117 1146 * Matches objects within the given bounds. 1118 1147 */
Note:
See TracChangeset
for help on using the changeset viewer.