public synchronized float[][] getNumAndPercent(String sFileName) { float xx[][] = new float[4][2]; int totalNum = 0 ; String strTemp = null; int i = 0; java.io.RandomAccessFile rf = null; try { rf = new java.io.RandomAccessFile (sFileName,"r"); } catch(Exception e) { System.out.println(e); System.exit(0); } for (i=0;i4;i++) { int m=0; try { strTemp = rf.readLine(); } catch (Exception e){ strTemp = "0"; }
if (strTemp == null) strTemp = "0"; m = new Integer(strTemp).intValue(); xx[i][0]=m; totalNum += m; } if (totalNum==0) totalNum=1; for ( i=0;i4;i++){ xx[i][1] = xx[i][0]/totalNum; } return xx; } }