From: <cob...@us...> - 2003-10-24 05:07:15
|
Update of /cvsroot/jrobin/src/jrobin/core In directory sc8-pr-cvs1:/tmp/cvs-serv5766/src/jrobin/core Modified Files: FetchData.java Util.java Log Message: New graph lib Switched to new FetchData method Index: FetchData.java =================================================================== RCS file: /cvsroot/jrobin/src/jrobin/core/FetchData.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FetchData.java 22 Oct 2003 13:47:09 -0000 1.3 --- FetchData.java 23 Oct 2003 23:16:36 -0000 1.4 *************** *** 127,130 **** --- 127,140 ---- /** + * Returns all archived values for all datasources. + * Returned values correspond to timestamps + * returned with {@link #getTimestamps() getTimestamps()} method. + * @return Two-dimensional aray of all datasource values. + */ + public double[][] getValues() { + return values; + } + + /** * Returns all archived values for a single datasource. * Returned values correspond to timestamps *************** *** 185,188 **** --- 195,212 ---- public String[] getDsNames() { return dsNames; + } + + /** + * Retrieve the table index number of a datasource by name. Names are case sensitive. + * @param dsName Name of the datasource for which to find the index. + * @return Index number of the datasources in the value table. + */ + public int getDsIndex( String dsName ) { + // Let's assume the table of dsNames is always small, so it is not necessary to use a hashmap for lookups + for (int i = 0; i < dsNames.length; i++) + if ( dsNames[i].equals(dsName) ) + return i; + + return -1; // Datasource not found ! } Index: Util.java =================================================================== RCS file: /cvsroot/jrobin/src/jrobin/core/Util.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Util.java 21 Oct 2003 19:42:00 -0000 1.7 --- Util.java 23 Oct 2003 23:16:36 -0000 1.8 *************** *** 183,189 **** { s2 = System.currentTimeMillis(); ! if ( str >= 0 ) timeList.addLast( str + "_" + (s2 - s1)); //System.err.println( "[" + str + "] --- " + (s2 - s1) + " ms"); s1 = s2; } --- 183,190 ---- { s2 = System.currentTimeMillis(); ! if ( str >= 0 ) { timeList.addLast( str + "_" + (s2 - s1)); //System.err.println( "[" + str + "] --- " + (s2 - s1) + " ms"); + } s1 = s2; } |