Changeset 10657 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss
- Timestamp:
- 2016-07-27T02:08:34+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
r10607 r10657 11 11 import java.util.Objects; 12 12 import java.util.Set; 13 import java.util.function.Predicate; 13 14 import java.util.regex.Pattern; 14 15 … … 26 27 import org.openstreetmap.josm.gui.mappaint.Environment; 27 28 import org.openstreetmap.josm.tools.CheckParameterUtil; 28 import org.openstreetmap.josm.tools.Predicate;29 29 import org.openstreetmap.josm.tools.Predicates; 30 import org.openstreetmap.josm.tools.SubclassFilteredCollection; 30 31 import org.openstreetmap.josm.tools.Utils; 31 32 … … 463 464 return e.osm.isKeyFalse(label) ^ negateResult; 464 465 case REGEX: 465 return Utils.exists(e.osm.keySet(),containsPattern) ^ negateResult;466 return e.osm.keySet().stream().anyMatch(containsPattern) ^ negateResult; 466 467 default: 467 468 return e.osm.hasKey(label) ^ negateResult; … … 486 487 String key = label; 487 488 if (KeyMatchType.REGEX.equals(matchType)) { 488 final Collection<String> matchingKeys = Utils.filter(p.keySet(), containsPattern);489 final Collection<String> matchingKeys = SubclassFilteredCollection.filter(p.keySet(), containsPattern); 489 490 if (!matchingKeys.isEmpty()) { 490 491 key = matchingKeys.iterator().next(); … … 666 667 */ 667 668 static boolean inDownloadedArea(Environment e) { // NO_UCD (unused code) 668 return IN_DOWNLOADED_AREA. evaluate(e.osm);669 return IN_DOWNLOADED_AREA.test(e.osm); 669 670 } 670 671 -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
r10627 r10657 38 38 import org.openstreetmap.josm.tools.Predicates; 39 39 import org.openstreetmap.josm.tools.RightAndLefthandTraffic; 40 import org.openstreetmap.josm.tools.SubclassFilteredCollection; 40 41 import org.openstreetmap.josm.tools.Utils; 41 42 import org.openstreetmap.josm.tools.Utils.Function; … … 1134 1135 public Float aggregateList(List<?> lst) { 1135 1136 final List<Float> floats = Utils.transform(lst, (Function<Object, Float>) x -> Cascade.convertTo(x, float.class)); 1136 final Collection<Float> nonNullList = Utils.filter(floats, Predicates.not(Predicates.isNull()));1137 final Collection<Float> nonNullList = SubclassFilteredCollection.filter(floats, Predicates.not(Predicates.isNull())); 1137 1138 return nonNullList.isEmpty() ? (Float) Float.NaN : computeMax ? Collections.max(nonNullList) : Collections.min(nonNullList); 1138 1139 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
r10627 r10657 25 25 import org.openstreetmap.josm.tools.Pair; 26 26 import org.openstreetmap.josm.tools.Predicates; 27 import org.openstreetmap.josm.tools.SubclassFilteredCollection; 27 28 import org.openstreetmap.josm.tools.Utils; 28 29 … … 320 321 throw new NoSuchElementException(); 321 322 } 322 final Collection<Relation> multipolygons = Utils.filteredCollection( Utils.filter(323 final Collection<Relation> multipolygons = Utils.filteredCollection(SubclassFilteredCollection.filter( 323 324 e.osm.getReferrers(), Predicates.hasTag("type", "multipolygon")), Relation.class); 324 325 final Relation multipolygon = multipolygons.iterator().next();
Note:
See TracChangeset
for help on using the changeset viewer.