Clover Coverage Report - WhatYouEat Coverage Report
Coverage timestamp: sab gen 3 2015 15:14:15 EST
../../../img/srcFileCovDistChart8.png 60% of files have more coverage
19   50   6   9,5
4   41   0,32   2
2     3  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  ObjectStoringThread       Line # 9 19 6 80% 0.8
 
No Tests
 
1    package co.harlequinmettle.healthfoodconcepts;
2   
3    import java.io.FileOutputStream;
4    import java.io.IOException;
5    import java.io.ObjectOutputStream;
6   
7    import android.content.Context;
8   
 
9    public class ObjectStoringThread implements Runnable{
10   
11    Context context;
12    float[][] db;
13    long time ;
14    float saveTime;
 
15  1 toggle public ObjectStoringThread(Context context,float[][] db ) {
16  1 this.context = context;
17  1 this.db = db;
18    }
19   
 
20  1 toggle public void run() {
21  1 if(!WhatYouEat._loaded){
22  0 try {
23  0 WhatYouEat.loadingThread.join();
24    } catch (InterruptedException e) {
25    // TODO Auto-generated catch block
26  0 e.printStackTrace();
27    }
28    }
29  1 System.out.println("STARTING TO SAVE DATA AS OBJECT NOW: ---->");
30  1 time = System.currentTimeMillis();
31  131 for (int i = 0; i < db.length; i++) {
32   
33  130 try {
34  130 FileOutputStream fos = context.openFileOutput(
35    ObjectLoadingThread.DATA_100G + i, Context.MODE_PRIVATE);
36  130 ObjectOutputStream objout = new ObjectOutputStream(fos);
37  130 objout.writeObject(db[i]);
38  130 objout.flush();
39  130 objout.close();
40   
41    } catch (IOException ioe) {
42  0 System.out.println("NO save: saver");
43    }
44  130 Thread.yield();
45    }
46   
47  1 saveTime = (float) ((System.currentTimeMillis() - time) / 1000.0);
48  1 System.out.println("----DONE SAVING DB---time to save db---->" + (saveTime));
49    }
50    }