Changeset 10599 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2016-07-23T02:08:50+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r10552 r10599 318 318 * 319 319 * @since 8954 320 */ 321 public abstract static class Strategy { 320 * @since 10599 (functional interface) 321 */ 322 @FunctionalInterface 323 public interface Strategy { 322 324 323 325 /** … … 327 329 * @return the way to keep 328 330 */ 329 public abstractWay determineWayToKeep(Iterable<Way> wayChunks);331 Way determineWayToKeep(Iterable<Way> wayChunks); 330 332 331 333 /** … … 333 335 * @return strategy which selects the way chunk with the highest node count to keep 334 336 */ 335 public static Strategy keepLongestChunk() { 336 return new Strategy() { 337 @Override 338 public Way determineWayToKeep(Iterable<Way> wayChunks) { 337 static Strategy keepLongestChunk() { 338 return wayChunks -> { 339 339 Way wayToKeep = null; 340 340 for (Way i : wayChunks) { … … 344 344 } 345 345 return wayToKeep; 346 } 347 }; 346 }; 348 347 } 349 348 … … 352 351 * @return strategy which selects the first way chunk 353 352 */ 354 public static Strategy keepFirstChunk() { 355 return new Strategy() { 356 @Override 357 public Way determineWayToKeep(Iterable<Way> wayChunks) { 358 return wayChunks.iterator().next(); 359 } 360 }; 353 static Strategy keepFirstChunk() { 354 return wayChunks -> wayChunks.iterator().next(); 361 355 } 362 356 }
Note:
See TracChangeset
for help on using the changeset viewer.