Changeset 7005 in josm for trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
- Timestamp:
- 2014-04-26T17:39:23+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r6890 r7005 121 121 public static <T extends OsmPrimitive> List<T> getFilteredList(Collection<OsmPrimitive> list, Class<T> type) { 122 122 if (list == null) return Collections.emptyList(); 123 List<T> ret = new LinkedList< T>();123 List<T> ret = new LinkedList<>(); 124 124 for(OsmPrimitive p: list) { 125 125 if (type.isInstance(p)) { … … 142 142 */ 143 143 public static <T extends OsmPrimitive> Set<T> getFilteredSet(Collection<OsmPrimitive> set, Class<T> type) { 144 Set<T> ret = new LinkedHashSet< T>();144 Set<T> ret = new LinkedHashSet<>(); 145 145 if (set != null) { 146 146 for(OsmPrimitive p: set) { … … 161 161 */ 162 162 public static Set<OsmPrimitive> getReferrer(Collection<? extends OsmPrimitive> primitives) { 163 HashSet<OsmPrimitive> ret = new HashSet< OsmPrimitive>();163 HashSet<OsmPrimitive> ret = new HashSet<>(); 164 164 if (primitives == null || primitives.isEmpty()) return ret; 165 165 for (OsmPrimitive p: primitives) { … … 632 632 public static Collection<String> getUninterestingKeys() { 633 633 if (uninteresting == null) { 634 LinkedList<String> l = new LinkedList< String>(Arrays.asList(634 LinkedList<String> l = new LinkedList<>(Arrays.asList( 635 635 "source", "source_ref", "source:", "comment", 636 636 "converted_by", "watch", "watch:", … … 731 731 */ 732 732 public Map<String, String> getInterestingTags() { 733 Map<String, String> result = new HashMap< String, String>();733 Map<String, String> result = new HashMap<>(); 734 734 String[] keys = this.keys; 735 735 if (keys != null) { … … 997 997 checkDataset(); 998 998 Object referrers = this.referrers; 999 List<OsmPrimitive> result = new ArrayList< OsmPrimitive>();999 List<OsmPrimitive> result = new ArrayList<>(); 1000 1000 if (referrers != null) { 1001 1001 if (referrers instanceof OsmPrimitive) { … … 1298 1298 public Collection<String> getTemplateKeys() { 1299 1299 Collection<String> keySet = keySet(); 1300 List<String> result = new ArrayList< String>(keySet.size() + 2);1300 List<String> result = new ArrayList<>(keySet.size() + 2); 1301 1301 result.add(SPECIAL_VALUE_ID); 1302 1302 result.add(SPECIAL_VALUE_LOCAL_NAME); … … 1331 1331 */ 1332 1332 public static Set<Relation> getParentRelations(Collection<? extends OsmPrimitive> primitives) { 1333 HashSet<Relation> ret = new HashSet< Relation>();1333 HashSet<Relation> ret = new HashSet<>(); 1334 1334 for (OsmPrimitive w : primitives) { 1335 1335 ret.addAll(OsmPrimitive.getFilteredList(w.getReferrers(), Relation.class));
Note:
See TracChangeset
for help on using the changeset viewer.