/[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 1568 by torben, Sat Jul 9 07:26:15 2011 UTC revision 1595 by torben, Wed Aug 31 20:32:50 2011 UTC
# Line 1  Line 1 
1  package dk.thoerup.traininfo.provider;  package dk.thoerup.traininfo.provider;
2    
 import java.io.EOFException;  
3  import java.io.File;  import java.io.File;
4  import java.io.FileInputStream;  import java.io.FileInputStream;
5  import java.io.FileOutputStream;  import java.io.FileOutputStream;
# Line 29  public class OfflineStationProvider impl Line 28  public class OfflineStationProvider impl
28                    
29          StationBean stations = new StationBean();          StationBean stations = new StationBean();
30    
31            public boolean hasStations() {
32                    return (stations != null && stations.entries.size() > 0);
33            }
34            
35    
36          public boolean loadStations(Context context) throws Exception {          public boolean loadStations(Context context) throws Exception {
37                  long start = System.currentTimeMillis();                  long start = System.currentTimeMillis();
# Line 151  public class OfflineStationProvider impl Line 154  public class OfflineStationProvider impl
154                  Collections.sort( entries, distanceComparator);                  Collections.sort( entries, distanceComparator);
155                                    
156                  StationBean tmpStations = new StationBean();                  StationBean tmpStations = new StationBean();
157                  for (int i = 0; i<8; i++) {                  for (int i = 0; i<8 && i<entries.size(); i++) {
158                          tmpStations.entries.add( entries.get(i) );                          tmpStations.entries.add( entries.get(i) );
159                  }                  }
160                                    

Legend:
Removed from v.1568  
changed lines
  Added in v.1595

  ViewVC Help
Powered by ViewVC 1.1.20