/[projects]/dao/DaoAdresseVedligehold/src/main/java/dk/daoas/adressevedligehold/coveragefileupload/AddressManager.java
ViewVC logotype

Diff of /dao/DaoAdresseVedligehold/src/main/java/dk/daoas/adressevedligehold/coveragefileupload/AddressManager.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2862 by torben, Thu Jan 28 11:07:07 2016 UTC revision 2868 by torben, Thu Jan 28 16:12:28 2016 UTC
# Line 33  public class AddressManager { Line 33  public class AddressManager {
33                    
34          Map<Integer, TreeMap<Short, ArrayList<Address>> > searchStructure;          Map<Integer, TreeMap<Short, ArrayList<Address>> > searchStructure;
35                    
36          ArrayList<AddressSourceEntry> afvisteEntries = new ArrayList<AddressSourceEntry>();          ArrayList<AddressSourceEntry> rejectedEntries = new ArrayList<AddressSourceEntry>();
37                    
38          Map<Short,Short> dbkBaneMap = new TreeMap<Short,Short>();          Map<Short,Short> dbkBaneMap = new TreeMap<Short,Short>();
39                    
# Line 233  public class AddressManager { Line 233  public class AddressManager {
233                          createFromEntry(entry); // if we get here there was no match - so we need to create it                          createFromEntry(entry); // if we get here there was no match - so we need to create it
234                          return;                          return;
235                  }                  }
236                                    boolean found = false;
237                  for (Address addr : litraList) {                  for (Address addr : litraList) {
238                          if (addr.husnrbogstav.equals(entry.litra) ) {                          if (addr.husnrbogstav.equals(entry.litra) ) {
239                                  updateAddress(addr, entry);                                  updateAddress(addr, entry);
240                                  return; //Done for now - no need to look at the rest of the list                                  found = true; // 1 visit should be enough but as long as there's duplicates on gadeid+husnr+litra we will visit them all
241                                    //when the issue with duplicates is resolved this should be reverted to a return or break
242                          }                          }
243                  }                  }
244                                    if (found == false) {
245                  createFromEntry(entry); // if we get here there was no match - so we need to create it                          createFromEntry(entry); // if we get here there was no match - so we need to create it
246                    }
247          }          }
248                    
249          private void visitRange(AddressSourceEntry entry) {          private void visitRange(AddressSourceEntry entry) {
# Line 287  public class AddressManager { Line 289  public class AddressManager {
289                    
290          private void updateAddress(Address addr, AddressSourceEntry entry) {          private void updateAddress(Address addr, AddressSourceEntry entry) {
291                  if ( addr.distributor != null && addr.distributor.equals(entry.distributor) == false) {                  if ( addr.distributor != null && addr.distributor.equals(entry.distributor) == false) {
292                          afvisteEntries.add(entry);                          rejectedEntries.add(entry);
293                          System.out.println("Afviser " + entry);                          System.out.println("Afviser " + entry);
294                          return;                          return;
295                  }                  }
# Line 593  public class AddressManager { Line 595  public class AddressManager {
595                          break;                          break;
596                  case "NS":                  case "NS":
597                          bane = 204;                          bane = 204;
598                          break;                                            break;
599                    default:
600                            throw new RuntimeException("Ukendt distributor" + a.distributor); //Silence findBugs
601                  }                  }
602                                    
603                  if (bane == null) {                  if (bane == null) {
# Line 614  public class AddressManager { Line 618  public class AddressManager {
618                    
619                    
620                    
621          public int getAfvistAntal() {          public int getRejectedCount() {
622                  return afvisteEntries.size();                  return rejectedEntries.size();
623          }          }
624                    
625  }  }

Legend:
Removed from v.2862  
changed lines
  Added in v.2868

  ViewVC Help
Powered by ViewVC 1.1.20