Changeset 32393 in osm for applications/editors/josm/plugins/seachart/src/s57
- Timestamp:
- 2016-06-24T02:19:11+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/seachart/src/s57
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/src/s57/S57att.java
r32082 r32393 32 32 } 33 33 34 private static final EnumMap<Att, Integer> AttS57 = new EnumMap< Att, Integer>(Att.class);34 private static final EnumMap<Att, Integer> AttS57 = new EnumMap<>(Att.class); 35 35 static { 36 36 AttS57.put(Att.UNKATT, 0); AttS57.put(Att.AGENCY, 1); AttS57.put(Att.BCNSHP, 2); AttS57.put(Att.BUISHP, 3); AttS57.put(Att.BOYSHP, 4); AttS57.put(Att.BURDEP, 5); … … 65 65 } 66 66 67 private static final EnumMap<Att, Integer> AttIENC = new EnumMap< Att, Integer>(Att.class);67 private static final EnumMap<Att, Integer> AttIENC = new EnumMap<>(Att.class); 68 68 static { 69 69 AttIENC.put(Att.CATACH, 17000); AttIENC.put(Att.CATDIS, 17001); AttIENC.put(Att.CATSIT, 17002); AttIENC.put(Att.CATSIW, 17003); AttIENC.put(Att.RESTRN, 17004); … … 88 88 } 89 89 90 private static final EnumMap<Att, String> AttStr = new EnumMap< Att, String>(Att.class);90 private static final EnumMap<Att, String> AttStr = new EnumMap<>(Att.class); 91 91 static { 92 92 AttStr.put(Att.UNKATT, ""); AttStr.put(Att.AGENCY, "agency"); AttStr.put(Att.BCNSHP, "shape"); AttStr.put(Att.BUISHP, "shape"); AttStr.put(Att.BOYSHP, "shape"); … … 307 307 private static final EnumMap<Obj, Att> Year = new EnumMap<>(Obj.class); static { Year.put(Obj.UNKOBJ, Att.RYRMGV); } 308 308 309 private static final HashMap<String, EnumMap<Obj, Att>> StrAtt = new HashMap< String, EnumMap<Obj, Att>>();309 private static final HashMap<String, EnumMap<Obj, Att>> StrAtt = new HashMap<>(); 310 310 static { 311 311 StrAtt.put("accuracy", Accuracy); StrAtt.put("addition", Addition); StrAtt.put("agency", Agency); StrAtt.put("anomaly", Anomaly); StrAtt.put("authority", Authority); -
applications/editors/josm/plugins/seachart/src/s57/S57map.java
r32380 r32393 84 84 first = 0; 85 85 last = 0; 86 nodes = new ArrayList< Long>();86 nodes = new ArrayList<>(); 87 87 } 88 88 } -
applications/editors/josm/plugins/seachart/src/s57/S57osm.java
r32082 r32393 38 38 OSMtags.put("waterway=riverbank", new KeyVal<>(Obj.RIVERS, Att.UNKATT, null, null)); OSMtags.put("waterway=dock", new KeyVal<>(Obj.HRBBSN, Att.UNKATT, null, null)); 39 39 OSMtags.put("waterway=lock", new KeyVal<>(Obj.HRBBSN, Att.UNKATT, null, null)); OSMtags.put("landuse=basin", new KeyVal<>(Obj.LAKARE, Att.UNKATT, null, null)); 40 OSMtags.put("wetland=tidalflat", new KeyVal< Double>(Obj.DEPARE, Att.DRVAL2, Conv.F, (Double)0.0)); OSMtags.put("tidal=yes", new KeyVal<Double>(Obj.DEPARE, Att.DRVAL2, Conv.F, (Double)0.0));40 OSMtags.put("wetland=tidalflat", new KeyVal<>(Obj.DEPARE, Att.DRVAL2, Conv.F, (Double)0.0)); OSMtags.put("tidal=yes", new KeyVal<>(Obj.DEPARE, Att.DRVAL2, Conv.F, (Double)0.0)); 41 41 OSMtags.put("natural=mud", new KeyVal<>(Obj.DEPARE, Att.UNKATT, null, null)); OSMtags.put("natural=sand", new KeyVal<>(Obj.DEPARE, Att.UNKATT, null, null)); 42 42 OSMtags.put("highway=motorway", new KeyVal<>(Obj.ROADWY, Att.CATROD, Conv.E, CatROD.ROD_MWAY)); OSMtags.put("highway=trunk", new KeyVal<>(Obj.ROADWY, Att.CATROD, Conv.E, CatROD.ROD_MAJR)); … … 56 56 if (kv != null) { 57 57 if (kv.conv == Conv.E) { 58 ArrayList<Enum<?>> list = new ArrayList< Enum<?>>();58 ArrayList<Enum<?>> list = new ArrayList<>(); 59 59 list.add((Enum<?>)kv.val); 60 60 osm.add(new KeyVal<>(kv.obj, kv.att, kv.conv, list)); -
applications/editors/josm/plugins/seachart/src/s57/S57val.java
r32380 r32393 1025 1025 } 1026 1026 1027 private static final EnumMap<Att, S57key> keys = new EnumMap< Att, S57key>(Att.class);1027 private static final EnumMap<Att, S57key> keys = new EnumMap<>(Att.class); 1028 1028 static { 1029 1029 keys.put(Att.UNKATT, new S57key(Conv.A, null)); keys.put(Att.AGENCY, new S57key(Conv.A, null)); keys.put(Att.BCNSHP, new S57key(Conv.E, Bcnshp)); … … 1143 1143 case A: 1144 1144 case S: 1145 return new AttVal< String>(conv, val);1145 return new AttVal<>(conv, val); 1146 1146 case E: 1147 ArrayList<Enum<?>> list = new ArrayList< Enum<?>>();1147 ArrayList<Enum<?>> list = new ArrayList<>(); 1148 1148 list.add(s57Enum(val, att)); 1149 1149 return new AttVal<ArrayList<?>>(Conv.E, list); 1150 1150 case L: 1151 list = new ArrayList< Enum<?>>();1151 list = new ArrayList<>(); 1152 1152 for (String item : val.split(",")) { 1153 1153 list.add(s57Enum(item, att)); … … 1156 1156 case I: 1157 1157 try { 1158 return new AttVal< Long>(Conv.I, Long.parseLong(val));1158 return new AttVal<>(Conv.I, Long.parseLong(val)); 1159 1159 } catch (Exception e) { 1160 1160 break; … … 1162 1162 case F: 1163 1163 try { 1164 return new AttVal< Double>(Conv.F, Double.parseDouble(val));1164 return new AttVal<>(Conv.F, Double.parseDouble(val)); 1165 1165 } catch (Exception e) { 1166 1166 break; … … 1236 1236 case A: 1237 1237 case S: 1238 return new AttVal< String>(Conv.S, val);1238 return new AttVal<>(Conv.S, val); 1239 1239 case E: 1240 ArrayList<Enum<?>> list = new ArrayList< Enum<?>>();1240 ArrayList<Enum<?>> list = new ArrayList<>(); 1241 1241 list.add(osmEnum(val, att)); 1242 1242 return new AttVal<ArrayList<?>>(Conv.E, list); 1243 1243 case L: 1244 list = new ArrayList< Enum<?>>();1244 list = new ArrayList<>(); 1245 1245 for (String item : val.split(";")) { 1246 1246 list.add(osmEnum(item, att)); … … 1249 1249 case I: 1250 1250 try { 1251 return new AttVal< Long>(Conv.I, Long.parseLong(val));1251 return new AttVal<>(Conv.I, Long.parseLong(val)); 1252 1252 } catch (Exception e) { 1253 1253 break; … … 1255 1255 case F: 1256 1256 try { 1257 return new AttVal< Double>(Conv.F, Double.parseDouble(val));1257 return new AttVal<>(Conv.F, Double.parseDouble(val)); 1258 1258 } catch (Exception e) { 1259 1259 break; 1260 1260 } 1261 1261 } 1262 return new AttVal< Object>(keys.get(att).conv, null);1262 return new AttVal<>(keys.get(att).conv, null); 1263 1263 } 1264 1264
Note:
See TracChangeset
for help on using the changeset viewer.