Ignore:
Timestamp:
2016-08-03T15:01:43+02:00 (8 years ago)
Author:
simon04
Message:

see #11390, see #12890 - Deprecate Predicates class

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

    r10674 r10715  
    2828import org.openstreetmap.josm.gui.mappaint.Environment;
    2929import org.openstreetmap.josm.tools.CheckParameterUtil;
    30 import org.openstreetmap.josm.tools.Predicates;
    3130import org.openstreetmap.josm.tools.Utils;
    3231
     
    513512            this.matchType = matchType == null ? KeyMatchType.EQ : matchType;
    514513            this.containsPattern = KeyMatchType.REGEX.equals(matchType)
    515                     ? Predicates.stringContainsPattern(Pattern.compile(label))
     514                    ? Pattern.compile(label).asPredicate()
    516515                    : null;
    517516        }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java

    r10691 r10715  
    1616import java.util.Collections;
    1717import java.util.List;
     18import java.util.Objects;
    1819import java.util.TreeSet;
    1920import java.util.function.Function;
     
    3738import org.openstreetmap.josm.tools.ColorHelper;
    3839import org.openstreetmap.josm.tools.Geometry;
    39 import org.openstreetmap.josm.tools.Predicates;
    4040import org.openstreetmap.josm.tools.RightAndLefthandTraffic;
    4141import org.openstreetmap.josm.tools.SubclassFilteredCollection;
     
    11351135        public Float aggregateList(List<?> lst) {
    11361136            final List<Float> floats = Utils.transform(lst, (Function<Object, Float>) x -> Cascade.convertTo(x, float.class));
    1137             final Collection<Float> nonNullList = SubclassFilteredCollection.filter(floats, Predicates.<Float>isNull().negate());
     1137            final Collection<Float> nonNullList = SubclassFilteredCollection.filter(floats, Objects::nonNull);
    11381138            return nonNullList.isEmpty() ? (Float) Float.NaN : computeMax ? Collections.max(nonNullList) : Collections.min(nonNullList);
    11391139        }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java

    r10674 r10715  
    2424import org.openstreetmap.josm.tools.Geometry;
    2525import org.openstreetmap.josm.tools.Pair;
    26 import org.openstreetmap.josm.tools.Predicates;
    2726import org.openstreetmap.josm.tools.SubclassFilteredCollection;
    2827import org.openstreetmap.josm.tools.Utils;
     
    322321                    }
    323322                    final Collection<Relation> multipolygons = Utils.filteredCollection(SubclassFilteredCollection.filter(
    324                             e.osm.getReferrers(), Predicates.hasTag("type", "multipolygon")), Relation.class);
     323                            e.osm.getReferrers(), p -> p.hasTag("type", "multipolygon")), Relation.class);
    325324                    final Relation multipolygon = multipolygons.iterator().next();
    326325                    if (multipolygon == null) throw new NoSuchElementException();
Note: See TracChangeset for help on using the changeset viewer.