Changeset 30157 in osm for applications/editors/josm/plugins/smed2/src/s57/S57val.java
- Timestamp:
- 2013-12-29T12:52:10+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/s57/S57val.java
r30046 r30157 26 26 } 27 27 28 public static class AttVal { 28 public static class AttVal<V> { 29 29 public Att att; 30 30 public Conv conv; 31 public Objectval;32 AttVal(Att a, Conv c, Objectv) {31 public V val; 32 AttVal(Att a, Conv c, V v) { 33 33 att = a; conv = c; val = v; 34 34 } … … 1141 1141 1142 1142 1143 public static String stringValue(AttVal attval) { // Convert OSeaM value object to OSeaM attribute value string 1143 public static String stringValue(AttVal<?> attval) { // Convert OSeaM value object to OSeaM attribute value string 1144 1144 switch (attval.conv) { 1145 1145 case A: … … 1177 1177 } 1178 1178 1179 public static AttVal convertValue(String val, Att att) { // Convert OSeaM attribute value string to OSeaM value object 1179 public static AttVal<?> convertValue(String val, Att att) { // Convert OSeaM attribute value string to OSeaM value object 1180 1180 switch (keys.get(att).conv) { 1181 1181 case A: 1182 1182 case S: 1183 return new AttVal(att, Conv.S, val); 1183 return new AttVal<String>(att, Conv.S, val); 1184 1184 case E: 1185 return new AttVal(att, Conv.E, enumValue(val, att)); 1185 return new AttVal<Enum<?>>(att, Conv.E, enumValue(val, att)); 1186 1186 case L: 1187 1187 ArrayList<Enum<?>> list = new ArrayList<Enum<?>>(); … … 1189 1189 list.add(enumValue(item, att)); 1190 1190 } 1191 return new AttVal(att, Conv.L, list); 1191 return new AttVal<ArrayList<?>>(att, Conv.L, list); 1192 1192 case I: 1193 1193 try { 1194 1194 long i = Long.parseLong(val); 1195 return new AttVal(att, Conv.I, i); 1195 return new AttVal<Long>(att, Conv.I, i); 1196 1196 } catch (Exception e) { 1197 1197 break; … … 1200 1200 try { 1201 1201 double f = Double.parseDouble(val); 1202 return new AttVal(att, Conv.F, f); 1202 return new AttVal<Double>(att, Conv.F, f); 1203 1203 } catch (Exception e) { 1204 1204 break; 1205 1205 } 1206 1206 } 1207 return new AttVal(att, keys.get(att).conv, null); 1207 return new AttVal<>(att, keys.get(att).conv, null); 1208 1208 } 1209 1209
Note:
See TracChangeset
for help on using the changeset viewer.