- Timestamp:
- 2018-06-11T01:32:42+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r13915 r13916 607 607 608 608 @Override 609 public Collection<OsmPrimitive> getSelected() {610 return new SubclassFilteredCollection<>(getAllSelected(), p -> !p.isDeleted());611 }612 613 @Override614 609 public Collection<OsmPrimitive> getAllSelected() { 615 610 return currentSelectedPrimitives; 616 }617 618 @Override619 public Collection<Node> getSelectedNodes() {620 return new SubclassFilteredCollection<>(getSelected(), Node.class::isInstance);621 }622 623 @Override624 public Collection<Way> getSelectedWays() {625 return new SubclassFilteredCollection<>(getSelected(), Way.class::isInstance);626 }627 628 @Override629 public Collection<Relation> getSelectedRelations() {630 return new SubclassFilteredCollection<>(getSelected(), Relation.class::isInstance);631 611 } 632 612 -
trunk/src/org/openstreetmap/josm/data/osm/OsmData.java
r13915 r13916 14 14 import org.openstreetmap.josm.data.osm.event.SelectionEventManager; 15 15 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 16 import org.openstreetmap.josm.tools.SubclassFilteredCollection; 16 17 17 18 /** … … 332 333 * @return unmodifiable collection of primitives 333 334 */ 334 Collection<O> getSelected(); 335 default Collection<O> getSelected() { 336 return new SubclassFilteredCollection<>(getAllSelected(), p -> !p.isDeleted()); 337 } 335 338 336 339 /** … … 348 351 * @return selected nodes 349 352 */ 350 Collection<N> getSelectedNodes(); 353 default Collection<N> getSelectedNodes() { 354 return new SubclassFilteredCollection<>(getSelected(), Node.class::isInstance); 355 } 351 356 352 357 /** … … 354 359 * @return selected ways 355 360 */ 356 Collection<W> getSelectedWays(); 361 default Collection<W> getSelectedWays() { 362 return new SubclassFilteredCollection<>(getSelected(), Way.class::isInstance); 363 } 357 364 358 365 /** … … 360 367 * @return selected relations 361 368 */ 362 Collection<R> getSelectedRelations(); 369 default Collection<R> getSelectedRelations() { 370 return new SubclassFilteredCollection<>(getSelected(), Relation.class::isInstance); 371 } 363 372 364 373 /**
Note:
See TracChangeset
for help on using the changeset viewer.