Ignore:
Timestamp:
2016-06-24T02:19:11+02:00 (9 years ago)
Author:
donvip
Message:

use diamond operator

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  
    3232 }
    3333
    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);
    3535 static {
    3636  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);
     
    6565 }
    6666
    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);
    6868 static {
    6969  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);
     
    8888 }
    8989 
    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);
    9191 static {
    9292  AttStr.put(Att.UNKATT, ""); AttStr.put(Att.AGENCY, "agency"); AttStr.put(Att.BCNSHP, "shape"); AttStr.put(Att.BUISHP, "shape"); AttStr.put(Att.BOYSHP, "shape");
     
    307307 private static final EnumMap<Obj, Att> Year = new EnumMap<>(Obj.class); static { Year.put(Obj.UNKOBJ, Att.RYRMGV); }
    308308 
    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<>();
    310310 static {
    311311  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  
    8484                        first = 0;
    8585                        last = 0;
    86                         nodes = new ArrayList<Long>();
     86                        nodes = new ArrayList<>();
    8787                }
    8888        }
  • applications/editors/josm/plugins/seachart/src/s57/S57osm.java

    r32082 r32393  
    3838                OSMtags.put("waterway=riverbank", new KeyVal<>(Obj.RIVERS, Att.UNKATT, null, null)); OSMtags.put("waterway=dock", new KeyVal<>(Obj.HRBBSN, Att.UNKATT, null, null));
    3939                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));
    4141                OSMtags.put("natural=mud", new KeyVal<>(Obj.DEPARE, Att.UNKATT, null, null)); OSMtags.put("natural=sand", new KeyVal<>(Obj.DEPARE, Att.UNKATT, null, null));
    4242                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));
     
    5656                if (kv != null) {
    5757                        if (kv.conv == Conv.E) {
    58                                 ArrayList<Enum<?>> list = new ArrayList<Enum<?>>();
     58                                ArrayList<Enum<?>> list = new ArrayList<>();
    5959                                list.add((Enum<?>)kv.val);
    6060                                osm.add(new KeyVal<>(kv.obj, kv.att, kv.conv, list));
  • applications/editors/josm/plugins/seachart/src/s57/S57val.java

    r32380 r32393  
    10251025 }
    10261026
    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);
    10281028 static {
    10291029  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));
     
    11431143  case A:
    11441144  case S:
    1145    return new AttVal<String>(conv, val);
     1145   return new AttVal<>(conv, val);
    11461146  case E:
    1147    ArrayList<Enum<?>> list = new ArrayList<Enum<?>>();
     1147   ArrayList<Enum<?>> list = new ArrayList<>();
    11481148   list.add(s57Enum(val, att));
    11491149   return new AttVal<ArrayList<?>>(Conv.E, list);
    11501150  case L:
    1151    list = new ArrayList<Enum<?>>();
     1151   list = new ArrayList<>();
    11521152   for (String item : val.split(",")) {
    11531153    list.add(s57Enum(item, att));
     
    11561156  case I:
    11571157   try {
    1158     return new AttVal<Long>(Conv.I, Long.parseLong(val));
     1158    return new AttVal<>(Conv.I, Long.parseLong(val));
    11591159   } catch (Exception e) {
    11601160    break;
     
    11621162  case F:
    11631163   try {
    1164     return new AttVal<Double>(Conv.F, Double.parseDouble(val));
     1164    return new AttVal<>(Conv.F, Double.parseDouble(val));
    11651165   } catch (Exception e) {
    11661166    break;
     
    12361236  case A:
    12371237  case S:
    1238    return new AttVal<String>(Conv.S, val);
     1238   return new AttVal<>(Conv.S, val);
    12391239  case E:
    1240    ArrayList<Enum<?>> list = new ArrayList<Enum<?>>();
     1240   ArrayList<Enum<?>> list = new ArrayList<>();
    12411241   list.add(osmEnum(val, att));
    12421242   return new AttVal<ArrayList<?>>(Conv.E, list);
    12431243  case L:
    1244    list = new ArrayList<Enum<?>>();
     1244   list = new ArrayList<>();
    12451245   for (String item : val.split(";")) {
    12461246    list.add(osmEnum(item, att));
     
    12491249  case I:
    12501250   try {
    1251     return new AttVal<Long>(Conv.I, Long.parseLong(val));
     1251    return new AttVal<>(Conv.I, Long.parseLong(val));
    12521252   } catch (Exception e) {
    12531253    break;
     
    12551255  case F:
    12561256   try {
    1257     return new AttVal<Double>(Conv.F, Double.parseDouble(val));
     1257    return new AttVal<>(Conv.F, Double.parseDouble(val));
    12581258   } catch (Exception e) {
    12591259    break;
    12601260   }
    12611261  }
    1262   return new AttVal<Object>(keys.get(att).conv, null);
     1262  return new AttVal<>(keys.get(att).conv, null);
    12631263 }
    12641264 
Note: See TracChangeset for help on using the changeset viewer.