/[projects]/dao/DaoAdresseService/src/dk/daoas/daoadresseservice/AdressSearch.java
ViewVC logotype

Diff of /dao/DaoAdresseService/src/dk/daoas/daoadresseservice/AdressSearch.java

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

revision 2283 by torben, Fri Feb 13 15:45:24 2015 UTC revision 2286 by torben, Fri Feb 13 16:15:49 2015 UTC
# Line 21  public class AdressSearch { Line 21  public class AdressSearch {
21    
22          List<Address> alleAdresser;          List<Address> alleAdresser;
23                    
         /* Mapper mellem db Row ID og adresse noden */  
         Map<Integer,Address> idAddressMap;  
           
24                    
25          Map<Integer,HundredePctBean> hundredePct;          Map<Integer,HundredePctBean> hundredePct;
26                    
# Line 80  public class AdressSearch { Line 77  public class AdressSearch {
77          public void buildSearchStructures() throws SQLException{          public void buildSearchStructures() throws SQLException{
78                  searchPostnrVejnavnGadeid = new HashMap<Integer, Map<String,Long>>();                  searchPostnrVejnavnGadeid = new HashMap<Integer, Map<String,Long>>();
79                  searchGadeidentAdresser = new HashMap<Long,  Map<String,Address>>();                  searchGadeidentAdresser = new HashMap<Long,  Map<String,Address>>();
80                  idAddressMap = new HashMap<Integer,Address>();                                  
                   
81                  System.out.println("Build -- stage 1");                  System.out.println("Build -- stage 1");
82                                    
83                  alleAdresser = DatabaseLayer.getAllAdresses();                  alleAdresser = DatabaseLayer.getAllAdresses();
84                                    
85                    
86                    /* Mapper mellem db Row ID og adresse noden */
87                    Map<Integer,Address> idAddressMap = new HashMap<Integer,Address>( alleAdresser.size() );
88                    
89                  for (Address a : alleAdresser) {                  for (Address a : alleAdresser) {
90                          idAddressMap.put(a.id, a);                          idAddressMap.put(a.id, a);
91                                                    
# Line 108  public class AdressSearch { Line 108  public class AdressSearch {
108                                  searchGadeidentAdresser.put(a.gadeid, gade);                                  searchGadeidentAdresser.put(a.gadeid, gade);
109                          }                          }
110                          String husnrSearch = "" + a.husnr + a.husnrbogstav;                          String husnrSearch = "" + a.husnr + a.husnrbogstav;
111                          gade.put(husnrSearch, a);                          gade.put(husnrSearch, a);                      
112                  }                  }
113                                    
114                                    
# Line 164  public class AdressSearch { Line 164  public class AdressSearch {
164                                                                    
165                                  orgAddress.distributor = targetAddress.distributor;                                  orgAddress.distributor = targetAddress.distributor;
166                          }                          }
   
                           
167                  }                  }
168                    
169                    // nu skal vi ikke bruge idAddressMap længere
170                    idAddressMap = null;
171                    
172                  //////////////////////////////////////////////////////////////////////////////////////                  //////////////////////////////////////////////////////////////////////////////////////
173                  System.out.println("Build -- stage 3 - 100pct");                  System.out.println("Build -- stage 3 - 100pct");
174                                    
175                  hundredePct = DatabaseLayer.get100PctList();                  hundredePct = DatabaseLayer.get100PctList();
176                  for (Address addr : alleAdresser) {                  for (Address addr : alleAdresser) {
177                          if (addr.daekningsType != DaekningsType.DAEKNING_IKKEDAEKKET) {                          if (addr.daekningsType != DaekningsType.DAEKNING_IKKEDAEKKET) {                        
178                                  continue;                                  continue;
179                          }                          }
180                                                    
# Line 193  public class AdressSearch { Line 195  public class AdressSearch {
195                          addr.distributor = bean.distributor;                          addr.distributor = bean.distributor;
196                  }                  }
197                                    
198                    ////////////////////////////////////////////////////////////////////////////////////
199                    System.out.println("Build -- Gathering statistics");
200                    
201                    int direkteCount = 0;
202                    int extendedCount = 0;
203                    int hundredePctCount = 0;
204                    int ikkeDaekketCount = 0;
205                    
206                    for (Address addr : alleAdresser) {
207                            switch (addr.daekningsType) {
208                            case DAEKNING_DIREKTE:
209                                    direkteCount++;
210                                    break;
211                            case DAEKNING_UDVIDET:
212                                    extendedCount++;
213                                    break;
214                            case DAEKNING_100PCT:
215                                    hundredePctCount++;
216                                    break;
217                            default:
218                                    ikkeDaekketCount++;
219                            }
220                    }
221                    
222                    System.out.println("Build: direkteCount: " + direkteCount);
223                    System.out.println("Build: extendedCount: " + extendedCount);
224                    System.out.println("Build: hundredePctCount: " + hundredePctCount);
225                    System.out.println("Build: ikkeDaekketCount: " + ikkeDaekketCount);
226                    
227                  System.out.println("Build Completed");                  System.out.println("Build Completed");
228                                    
229          }          }

Legend:
Removed from v.2283  
changed lines
  Added in v.2286

  ViewVC Help
Powered by ViewVC 1.1.20