Ignore:
Timestamp:
2014-05-22T20:55:57+02:00 (9 years ago)
Author:
simon04
Message:

fix #10063 - MapCSS: make min() and max() work on a list as well

For instance, max(split(";", tag(widths))) splits the tag widths on semicolons and determines the largest numeric value

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Predicates.java

    r7083 r7170  
    2828
    2929    /**
    30      * Returns a {@link Predicate} executing {@link Utils#equal}.
     30     * Returns a {@link Predicate} executing {@link Objects#equals}.
    3131     */
    3232    public static <T> Predicate<T> equalTo(final T ref) {
     
    110110        };
    111111    }
     112
     113    /**
     114     * Returns a {@link Predicate} testing whether objects are {@code null}.
     115     */
     116    public static <T> Predicate<T> isNull() {
     117        return new Predicate<T>() {
     118            @Override
     119            public boolean evaluate(T object) {
     120                return object == null;
     121            }
     122        };
     123    }
    112124}
Note: See TracChangeset for help on using the changeset viewer.