Changeset 11680 in josm for trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitiveComparator.java
- Timestamp:
- 2017-03-05T01:10:20+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitiveComparator.java
r11177 r11680 69 69 } 70 70 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 71 92 private static <T, R> Function<T, R> memoize(Function<T, R> base) { 72 93 final Map<T, R> cache = new HashMap<>();
Note:
See TracChangeset
for help on using the changeset viewer.