Changeset 2341 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2009-10-28T19:33:49+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r2309 r2341 11 11 import java.util.HashMap; 12 12 import java.util.HashSet; 13 import java.util.LinkedHashSet; 13 14 import java.util.LinkedList; 14 15 import java.util.List; … … 83 84 * @return the sub-set of OSM primitives of type <code>type</code> 84 85 */ 85 static public <T extends OsmPrimitive> Set<T> getFilteredSet(Collection<OsmPrimitive> set, Class<T> type) { 86 if (set == null) return Collections.emptySet(); 87 HashSet<T> ret = new HashSet<T>(); 88 for(OsmPrimitive p: set) { 89 if (type.isInstance(p)) { 90 ret.add(type.cast(p)); 86 static public <T extends OsmPrimitive> LinkedHashSet<T> getFilteredSet(Collection<OsmPrimitive> set, Class<T> type) { 87 LinkedHashSet<T> ret = new LinkedHashSet<T>(); 88 if (set != null) { 89 for(OsmPrimitive p: set) { 90 if (type.isInstance(p)) { 91 ret.add(type.cast(p)); 92 } 91 93 } 92 94 }
Note:
See TracChangeset
for help on using the changeset viewer.