Ignore:
Timestamp:
2017-03-05T01:10:20+01:00 (3 years ago)
Author:
Don-vip
Message:

fix #14458 - sort by default in order [relations, ways, nodes] in selection dialog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitiveComparator.java

    r11177 r11680  
    6969    }
    7070
     71    /**
     72     * Returns a comparator ordering the primitives by type in the order RELATION, WAY, NODE
     73     *
     74     * @return a comparator ordering the primitives by type in the order RELATION, WAY, NODE
     75     * @since 11679
     76     */
     77    public static Comparator<OsmPrimitive> orderingRelationsWaysNodes() {
     78        return comparingInt(osm -> {
     79            switch (osm.getType()) {
     80                case RELATION:
     81                    return 1;
     82                case WAY:
     83                    return 2;
     84                case NODE:
     85                    return 3;
     86                default:
     87                    throw new IllegalStateException();
     88            }
     89        });
     90    }
     91
    7192    private static <T, R> Function<T, R> memoize(Function<T, R> base) {
    7293        final Map<T, R> cache = new HashMap<>();
Note: See TracChangeset for help on using the changeset viewer.