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 |
|
|
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) { |
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 |
} |
} |
446 |
|
|
447 |
|
|
448 |
|
|
449 |
addr.visited = true; |
//addr.visited = true; |
450 |
if (addr.state == AddressState.NOT_CHANGED) { |
if (addr.state == AddressState.NOT_CHANGED) { |
451 |
if (addr.distributor == null) { |
if (addr.distributor == null) { |
452 |
addr.state = AddressState.OPENED; |
addr.state = AddressState.OPENED; |
496 |
a.husnr = entry.husnr; |
a.husnr = entry.husnr; |
497 |
a.husnrbogstav = entry.litra; |
a.husnrbogstav = entry.litra; |
498 |
a.postnr = entry.postnr; |
a.postnr = entry.postnr; |
499 |
a.visited = true; |
//a.visited = true; |
500 |
|
|
501 |
if (entry.ugedage.mandag) { |
if (entry.ugedage.mandag) { |
502 |
a.ruteMandag = entry.rute; |
a.ruteMandag = entry.rute; |
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) { |
618 |
|
|
619 |
|
|
620 |
|
|
621 |
public int getAfvistAntal() { |
public int getRejectedCount() { |
622 |
return afvisteEntries.size(); |
return rejectedEntries.size(); |
623 |
} |
} |
624 |
|
|
625 |
} |
} |