@Override public boolean isCoveredBy(AttributeMatcher attributeMatcher) { if (attributeMatcher == this) { return true; } List<Tag> tags = new ArrayList<Tag>(this.values.size()); for (int i = 0, n = this.values.size(); i < n; ++i) { tags.add(new Tag(null, this.values.get(i))); } return attributeMatcher.matches(tags); }
@Override public boolean isCoveredBy(AttributeMatcher attributeMatcher) { if (attributeMatcher == this) { return true; } List<Tag> tags = new ArrayList<Tag>(this.keys.size()); for (int i = 0, n = this.keys.size(); i < n; ++i) { tags.add(new Tag(this.keys.get(i), null)); } return attributeMatcher.matches(tags); }
@Override boolean matchesNode(List<Tag> tags, byte zoomLevel) { return this.zoomMin <= zoomLevel && this.zoomMax >= zoomLevel && this.elementMatcher.matches(Element.NODE) && this.attributeMatcher.matches(tags); }
@Override boolean matchesWay(List<Tag> tags, byte zoomLevel, Closed closed) { return this.zoomMin <= zoomLevel && this.zoomMax >= zoomLevel && this.elementMatcher.matches(Element.WAY) && this.closedMatcher.matches(closed) && this.attributeMatcher.matches(tags); } }
@Test public void matchesTest() { Tag tag1 = new Tag(null, VALUE1); Tag tag2 = new Tag(null, VALUE2); AttributeMatcher attributeMatcher = new ValueMatcher(Arrays.asList(VALUE1)); Assert.assertTrue(attributeMatcher.matches(Arrays.asList(tag1))); Assert.assertFalse(attributeMatcher.matches(Arrays.asList(tag2))); } }
@Test public void matchesTest() { Tag tag1 = new Tag(KEY1, null); Tag tag2 = new Tag(KEY2, null); AttributeMatcher attributeMatcher = new KeyMatcher(Arrays.asList(KEY1)); Assert.assertTrue(attributeMatcher.matches(Arrays.asList(tag1))); Assert.assertFalse(attributeMatcher.matches(Arrays.asList(tag2))); } }
@Override public boolean isCoveredBy(AttributeMatcher attributeMatcher) { if (attributeMatcher == this) { return true; } List<Tag> tags = new ArrayList<Tag>(this.values.size()); for (int i = 0, n = this.values.size(); i < n; ++i) { tags.add(new Tag(null, this.values.get(i))); } return attributeMatcher.matches(tags); }
@Override public boolean isCoveredBy(AttributeMatcher attributeMatcher) { if (attributeMatcher == this) { return true; } List<Tag> tags = new ArrayList<Tag>(this.keys.size()); for (int i = 0, n = this.keys.size(); i < n; ++i) { tags.add(new Tag(this.keys.get(i), null)); } return attributeMatcher.matches(tags); }
@Override boolean matchesNode(List<Tag> tags, byte zoomLevel) { return this.zoomMin <= zoomLevel && this.zoomMax >= zoomLevel && this.elementMatcher.matches(Element.NODE) && this.attributeMatcher.matches(tags); }
@Override boolean matchesWay(List<Tag> tags, byte zoomLevel, Closed closed) { return this.zoomMin <= zoomLevel && this.zoomMax >= zoomLevel && this.elementMatcher.matches(Element.WAY) && this.closedMatcher.matches(closed) && this.attributeMatcher.matches(tags); } }