/[projects]/android/TrainInfo/src/dk/thoerup/traininfo/provider/OfflineStationProvider.java
ViewVC logotype

Diff of /android/TrainInfo/src/dk/thoerup/traininfo/provider/OfflineStationProvider.java

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

revision 1794 by torben, Wed Apr 11 16:47:27 2012 UTC revision 1795 by torben, Wed Apr 11 17:45:34 2012 UTC
# Line 189  public class OfflineStationProvider impl Line 189  public class OfflineStationProvider impl
189                  name = name.toLowerCase();                  name = name.toLowerCase();
190                  StationBean tmpStations = new StationBean();                  StationBean tmpStations = new StationBean();
191                  for (StationEntry entry : stations.entries) {                  for (StationEntry entry : stations.entries) {
192                          if (entry.nameLower.startsWith(name) || entry.nameInternational.startsWith(name) ) {                          if (entry.nameLower.startsWith(name) || entry.nameInternational.startsWith(name) || aliasNameMatch(name,entry) ) {
193                                  tmpStations.entries.add(entry);                                  tmpStations.entries.add(entry);
194                          } else {                                                          }
                                 for(String alias : entry.getAliases()) {  
                                         if (alias.startsWith(name)) {  
                                                 tmpStations.entries.add(entry);  
                                                 break;  
                                         }  
                                 }                                
                         }  
195                  }                  }
196                  logElapsedTime(start, "name");                                            logElapsedTime(start, "name");                          
197                  return tmpStations;                  return tmpStations;
198          }          }
199            
200            private boolean aliasNameMatch(String name, StationEntry station) {
201                    for(String alias : station.getAliases()) {
202                            if (alias.startsWith(name)) {
203                                    return true;
204                            }
205                    }
206                    return false;
207            }
208    
209          @Override          @Override
210          public StationBean lookupStationsByIds(String ids) {          public StationBean lookupStationsByIds(String ids) {

Legend:
Removed from v.1794  
changed lines
  Added in v.1795

  ViewVC Help
Powered by ViewVC 1.1.20