Changeset 30737 in osm for applications/editors/josm/plugins/czechaddress
- Timestamp:
- 2014-10-18T23:07:52+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/CzechAddressPlugin.java
r29957 r30737 58 58 59 59 private JMenu czechMenu; 60 private List<JMenuItem> menuItems = new ArrayList< JMenuItem>();60 private List<JMenuItem> menuItems = new ArrayList<>(); 61 61 private static Logger logger = Logger.getLogger(CzechAddressPlugin.class.getName()); 62 62 … … 174 174 } 175 175 176 static private final Set<StatusListener> listeners = new HashSet< StatusListener>();176 static private final Set<StatusListener> listeners = new HashSet<>(); 177 177 static public synchronized void addStatusListener(StatusListener l) {listeners.add(l);} 178 178 static public synchronized void removeStatusListener(StatusListener l) {listeners.remove(l);} -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/StringUtils.java
r30346 r30737 63 63 s2 = anglicize(s2); 64 64 65 List<Integer> beg1 = new ArrayList< Integer>(4);66 List<Integer> beg2 = new ArrayList< Integer>(4);65 List<Integer> beg1 = new ArrayList<>(4); 66 List<Integer> beg2 = new ArrayList<>(4); 67 67 68 68 char lastChar = ' '; -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/actions/SplitAreaByEmptyWayAction.java
r29778 r30737 55 55 56 56 Collection<Way> selectedWays = Main.main.getCurrentDataSet().getSelectedWays(); 57 Collection<Way> newSelection = new LinkedList< Way>(Main.main.getCurrentDataSet().getSelectedWays());57 Collection<Way> newSelection = new LinkedList<>(Main.main.getCurrentDataSet().getSelectedWays()); 58 58 59 59 for (Way area : selectedWays) { -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/Database.java
r23190 r30737 29 29 * List of regions, which are in this database. 30 30 */ 31 public ArrayList<Region> regions = new ArrayList< Region>();31 public ArrayList<Region> regions = new ArrayList<>(); 32 32 33 33 public Region findRegion(String name, String nuts3, String nuts4) { -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/ElementWithHouses.java
r30532 r30737 18 18 } 19 19 20 protected List<House> houses = new ArrayList< House>(30);20 protected List<House> houses = new ArrayList<>(30); 21 21 22 22 /** -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/ElementWithStreets.java
r23190 r30737 13 13 public abstract class ElementWithStreets extends ElementWithHouses { 14 14 15 private ArrayList<Street> streets = new ArrayList< Street>();15 private ArrayList<Street> streets = new ArrayList<>(); 16 16 17 17 public ElementWithStreets(String name) { … … 78 78 public List<House> getAllHouses() { 79 79 // We make an conservative estimate... 80 List<House> result = new ArrayList< House>(20 * streets.size());80 List<House> result = new ArrayList<>(20 * streets.size()); 81 81 82 82 result.addAll(this.houses); -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/House.java
r26509 r30737 189 189 public List<Proposal> getDiff(OsmPrimitive prim) { 190 190 191 List<Proposal> props = new NotNullList< Proposal>();191 List<Proposal> props = new NotNullList<>(); 192 192 ParentResolver resolver = new ParentResolver(this); 193 193 -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/Region.java
r23190 r30737 12 12 13 13 private ArrayList<ViToCi> vitocis 14 = new ArrayList< ViToCi>();14 = new ArrayList<>(); 15 15 16 16 /** -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/Street.java
r23190 r30737 43 43 @Override 44 44 public List<Proposal> getDiff(OsmPrimitive prim) { 45 List<Proposal> props = new NotNullList< Proposal>();45 List<Proposal> props = new NotNullList<>(); 46 46 47 47 props.add(getStringFieldDiff(PrimUtils.KEY_NAME, prim.get(PrimUtils.KEY_NAME), getName())); -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/ViToCi.java
r23190 r30737 11 11 public class ViToCi extends ElementWithStreets { 12 12 13 private ArrayList<Suburb> suburbs = new ArrayList< Suburb>();13 private ArrayList<Suburb> suburbs = new ArrayList<>(); 14 14 15 15 /** -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/ConflictResolver.java
r30532 r30737 327 327 private class ConflictsModel implements ComboBoxModel<Object> { 328 328 329 ArrayList<AddressElement> elements = new ArrayList< AddressElement>();330 ArrayList<OsmPrimitive> primitives = new ArrayList< OsmPrimitive>();331 Set<ListDataListener> listeners = new HashSet< ListDataListener>();329 ArrayList<AddressElement> elements = new ArrayList<>(); 330 ArrayList<OsmPrimitive> primitives = new ArrayList<>(); 331 Set<ListDataListener> listeners = new HashSet<>(); 332 332 333 333 Object selected = null; … … 470 470 if (selected instanceof AddressElement) { 471 471 AddressElement selElem = (AddressElement) selected; 472 List<OsmPrimitive> conflPrims = new NotNullList< OsmPrimitive>();472 List<OsmPrimitive> conflPrims = new NotNullList<>(); 473 473 conflPrims.addAll(Reasoner.getInstance().getCandidates(selElem)); 474 474 Collections.sort(conflPrims, PrimUtils.comparator); … … 477 477 } else if (selected instanceof OsmPrimitive) { 478 478 OsmPrimitive selElem = (OsmPrimitive) selected; 479 List<AddressElement> conflElems = new NotNullList< AddressElement>();479 List<AddressElement> conflElems = new NotNullList<>(); 480 480 conflElems.addAll(Reasoner.getInstance().getCandidates(selElem)); 481 481 Collections.sort(conflElems); … … 514 514 private class CandidatesModel<E> implements ComboBoxModel<E> { 515 515 516 Set<ListDataListener> listeners = new HashSet< ListDataListener>();516 Set<ListDataListener> listeners = new HashSet<>(); 517 517 List<? extends E> primitives; 518 518 Object selected = null; -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/FactoryDialog.java
r30532 r30737 473 473 474 474 private List<ElementWithHouses> metaElem 475 = new ArrayList< ElementWithHouses>();475 = new ArrayList<>(); 476 476 477 477 public StreetListModel() { -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/LocationSelector.java
r30532 r30737 33 33 34 34 protected ElementWithStreets selectedElement; 35 protected ArrayList<ItemListener> listeners = new ArrayList< ItemListener>();35 protected ArrayList<ItemListener> listeners = new ArrayList<>(); 36 36 int regionHlIndex, vitociHlIndex, suburbHlIndex; 37 protected ArrayList<AddressElement> hlRegions = new ArrayList< AddressElement>();38 protected ArrayList<AddressElement> hlViToCis = new ArrayList< AddressElement>();39 protected ArrayList<AddressElement> hlSuburbs = new ArrayList< AddressElement>();37 protected ArrayList<AddressElement> hlRegions = new ArrayList<>(); 38 protected ArrayList<AddressElement> hlViToCis = new ArrayList<>(); 39 protected ArrayList<AddressElement> hlSuburbs = new ArrayList<>(); 40 40 41 41 -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/ManagerDialog.java
r29854 r30737 36 36 public class ManagerDialog extends ExtendedDialog { 37 37 38 RenameModel<Street> streetModel = new RenameModel< Street>();38 RenameModel<Street> streetModel = new RenameModel<>(); 39 39 40 40 public ManagerDialog() { … … 382 382 private class RenameModel<Element> implements TableModel { 383 383 384 List<Element> elems = new ArrayList< Element>();385 List<String> names = new ArrayList< String>();384 List<Element> elems = new ArrayList<>(); 385 List<String> names = new ArrayList<>(); 386 386 387 387 public int getRowCount() { -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/PointManipulatorDialog.java
r30532 r30737 137 137 OsmPrimitive prim = this.proposalContainer.getTarget(); 138 138 Reasoner r = Reasoner.getInstance(); 139 List<AddressElement> elems = new NotNullList< AddressElement>();139 List<AddressElement> elems = new NotNullList<>(); 140 140 141 141 synchronized (r) { -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/HalfCookedComboBoxModel.java
r30532 r30737 18 18 public abstract class HalfCookedComboBoxModel<E> implements ComboBoxModel<E> { 19 19 20 List<ListDataListener> listeners = new ArrayList< ListDataListener>();20 List<ListDataListener> listeners = new ArrayList<>(); 21 21 22 22 @Override -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/HalfCookedListModel.java
r30532 r30737 18 18 public abstract class HalfCookedListModel<E> implements ListModel<E> { 19 19 20 List<ListDataListener> listeners = new ArrayList< ListDataListener>();20 List<ListDataListener> listeners = new ArrayList<>(); 21 21 22 22 @Override -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/HalfCookedTreeModel.java
r15585 r30737 20 20 public abstract class HalfCookedTreeModel implements TreeModel { 21 21 22 List<TreeModelListener> listeneres = new ArrayList< TreeModelListener>();22 List<TreeModelListener> listeneres = new ArrayList<>(); 23 23 24 24 protected String root; -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/intelligence/Capitalizator.java
r18503 r30737 33 33 int expResults = elems.size()/2; 34 34 35 map = new HashMap< Street, OsmPrimitive>(expResults);35 map = new HashMap<>(expResults); 36 36 ExecutorService serv = Executors.newCachedThreadPool(); 37 37 Map<Street, Future<OsmPrimitive>> results 38 = new HashMap< Street, Future<OsmPrimitive>>(expResults);38 = new HashMap<>(expResults); 39 39 40 40 for (Street elem : elems) -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/intelligence/Reasoner.java
r26509 r30737 44 44 45 45 private Map<OsmPrimitive, AddressElement> primBestIndex 46 = new HashMap< OsmPrimitive, AddressElement> ();46 = new HashMap<> (); 47 47 private Map<AddressElement, OsmPrimitive> elemBestIndex 48 = new HashMap< AddressElement, OsmPrimitive> ();48 = new HashMap<> (); 49 49 50 50 private Map<OsmPrimitive, Map<AddressElement, Integer>> primMatchIndex 51 = new HashMap< OsmPrimitive, Map<AddressElement, Integer>> ();51 = new HashMap<> (); 52 52 private Map<AddressElement, Map<OsmPrimitive, Integer>> elemMatchIndex 53 = new HashMap< AddressElement, Map<OsmPrimitive, Integer>> ();54 55 private Set<OsmPrimitive> primToUpdate = new HashSet< OsmPrimitive>();56 private Set<AddressElement> elemToUpdate = new HashSet< AddressElement>();53 = new HashMap<> (); 54 55 private Set<OsmPrimitive> primToUpdate = new HashSet<>(); 56 private Set<AddressElement> elemToUpdate = new HashSet<>(); 57 57 58 58 public static Logger logger = Logger.getLogger(Reasoner.class.getName()); … … 127 127 assert transactionOpened; 128 128 129 Set<AddressElement> elemChanges = new HashSet< AddressElement>();130 Set<OsmPrimitive> primChanges = new HashSet< OsmPrimitive>();129 Set<AddressElement> elemChanges = new HashSet<>(); 130 Set<OsmPrimitive> primChanges = new HashSet<>(); 131 131 132 132 for (OsmPrimitive prim : primToUpdate) { … … 204 204 if (matches == null) { 205 205 logger.log(Level.FINE, "new primitive detected", AddressElement.getName(prim)); 206 matches = new HashMap< AddressElement, Integer>();206 matches = new HashMap<>(); 207 207 primMatchIndex.put(prim, matches); 208 208 primToUpdate.add(prim); … … 232 232 if (matches == null) { 233 233 logger.log(Level.FINE, "new element detected", elem); 234 matches = new HashMap< OsmPrimitive, Integer>();234 matches = new HashMap<>(); 235 235 elemMatchIndex.put(elem, matches); 236 236 elemToUpdate.add(elem); … … 472 472 public Set<AddressElement> getCandidates(OsmPrimitive prim) { 473 473 474 Set<AddressElement> result = new HashSet< AddressElement>();474 Set<AddressElement> result = new HashSet<>(); 475 475 if (primMatchIndex.get(prim) == null) return result; 476 476 … … 506 506 public Set<OsmPrimitive> getCandidates(AddressElement elem) { 507 507 508 Set<OsmPrimitive> result = new HashSet< OsmPrimitive>();508 Set<OsmPrimitive> result = new HashSet<>(); 509 509 if (elemMatchIndex.get(elem) == null) return result; 510 510 … … 627 627 */ 628 628 public Set<AddressElement> getUnassignedElements() { 629 Set<AddressElement> result = new HashSet< AddressElement>();629 Set<AddressElement> result = new HashSet<>(); 630 630 for (AddressElement elem : elemMatchIndex.keySet()) 631 631 if (translate(elem) == null) … … 638 638 */ 639 639 public Set<OsmPrimitive> getUnassignedPrimitives() { 640 Set<OsmPrimitive> result = new HashSet< OsmPrimitive>();640 Set<OsmPrimitive> result = new HashSet<>(); 641 641 for (OsmPrimitive prim : primMatchIndex.keySet()) 642 642 if (translate(prim) == null) … … 650 650 */ 651 651 public Set<AddressElement> getAllElements() { 652 Set<AddressElement> result = new HashSet< AddressElement>();652 Set<AddressElement> result = new HashSet<>(); 653 653 result.addAll(elemMatchIndex.keySet()); 654 654 return result; … … 660 660 */ 661 661 public Set<OsmPrimitive> getAllPrimitives() { 662 Set<OsmPrimitive> result = new HashSet< OsmPrimitive>();662 Set<OsmPrimitive> result = new HashSet<>(); 663 663 result.addAll(primMatchIndex.keySet()); 664 664 return result; … … 695 695 * Set of listeners currently hooked to changes in this reasoner. 696 696 */ 697 private Set<ReasonerListener> listeners = new HashSet< ReasonerListener>();697 private Set<ReasonerListener> listeners = new HashSet<>(); 698 698 699 699 /** -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/intelligence/SelectionMonitor.java
r26299 r30737 20 20 public class SelectionMonitor implements SelectionChangedListener { 21 21 22 Collection<OsmPrimitive> lastSelection = new NotNullList< OsmPrimitive>();22 Collection<OsmPrimitive> lastSelection = new NotNullList<>(); 23 23 24 24 private SelectionMonitor() {} -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/proposal/ProposalContainer.java
r30532 r30737 29 29 */ 30 30 private List<ListDataListener> listeners = 31 new ArrayList< ListDataListener>();31 new ArrayList<>(); 32 32 33 33 /** … … 64 64 * The list of proposals to be applied to encapsulated primitive. 65 65 */ 66 protected List<Proposal> proposals = new ArrayList< Proposal>();66 protected List<Proposal> proposals = new ArrayList<>(); 67 67 68 68 /** -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/proposal/ProposalDatabase.java
r23190 r30737 25 25 */ 26 26 protected List<ProposalContainer> changeSet = 27 new ArrayList< ProposalContainer>();27 new ArrayList<>(); 28 28 29 29 /** … … 31 31 */ 32 32 protected List<TreeModelListener> listeners = 33 new ArrayList< TreeModelListener>();33 new ArrayList<>(); 34 34 35 35 /**
Note:
See TracChangeset
for help on using the changeset viewer.