Changeset 15893 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2020-02-22T13:50:02+01:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/autofilter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/autofilter/AutoFilterManager.java
r15851 r15893 159 159 @Override 160 160 public SearchCompiler.Match get() { 161 return new SearchCompiler.Match() { 162 @Override 163 public boolean match(OsmPrimitive osm) { 164 return rule.getTagValuesForPrimitive(osm).anyMatch(v -> v == value); 165 } 166 }; 161 return new Match(rule, value); 162 } 163 } 164 165 static class Match extends SearchCompiler.Match { 166 final AutoFilterRule rule; 167 final int value; 168 169 Match(AutoFilterRule rule, int value) { 170 this.rule = rule; 171 this.value = value; 172 } 173 174 @Override 175 public boolean match(OsmPrimitive osm) { 176 return rule.getTagValuesForPrimitive(osm).anyMatch(v -> v == value); 177 } 178 179 @Override 180 public boolean equals(Object o) { 181 if (this == o) return true; 182 if (o == null || getClass() != o.getClass()) return false; 183 Match match = (Match) o; 184 return value == match.value && 185 Objects.equals(rule, match.rule); 186 } 187 188 @Override 189 public int hashCode() { 190 return Objects.hash(rule, value); 167 191 } 168 192 } -
trunk/src/org/openstreetmap/josm/gui/autofilter/AutoFilterRule.java
r15843 r15893 192 192 193 193 @Override 194 public boolean equals(Object o) { 195 if (this == o) return true; 196 if (o == null || getClass() != o.getClass()) return false; 197 AutoFilterRule that = (AutoFilterRule) o; 198 return Objects.equals(key, that.key); 199 } 200 201 @Override 202 public int hashCode() { 203 return Objects.hash(key); 204 } 205 206 @Override 194 207 public String toString() { 195 208 return key + '[' + minZoomLevel + ']';
Note:
See TracChangeset
for help on using the changeset viewer.