//Runs through the transactions and files each one void fillCells(){ //calculate number of items within desired dewey ranges Transaction t; int targetrow; int targetcol; for (int i = 0; i < transactions.size(); i++) { t = (Transaction)transactions.get(i); //IF the item has a legitamate dewey classifcation // AND it has a legitimate title // AND the ckotime is within the desired range //THEN // Assign colors/values based on the dewey numbers if (t.deweyClass.length() > 0 && t.title.length() > 0 ) // if (t.deweyClass.length() > 0 && t.title.length() > 0 ) { // COME BACK TO THIS, A CASE-BASED APPROACH WOULD BE MUCH FASTER //FIND THE RIGHT CELL targetrow = (int) ( (rows) * t.getTime() ); //targetcol = floor( (cols-1) * t.getDay()) targetcol = t.getDayNumber() - 1 ; if ( ( t.getBigDewey() >= deweyclassredstart && t.getBigDewey() < deweyclassredfinish)) { grid[targetcol][targetrow].redhits++; grid[targetcol][targetrow].hits++; } if ( ( t.getBigDewey() >= deweyclassgreenstart && t.getBigDewey() < deweyclassgreenfinish)) { grid[targetcol][targetrow].greenhits++; grid[targetcol][targetrow].hits++; } if ( ( t.getBigDewey() >= deweyclassbluestart && t.getBigDewey() < deweyclassbluefinish)) { grid[targetcol][targetrow].bluehits++; grid[targetcol][targetrow].hits++; } if (t.getMinute() == 0) { grid[targetcol][targetrow].topOthe = true; } //grid[targetcol][targetrow].ckotimestart if ( t.getTime() < grid[targetcol][targetrow].ckotimestart ) { grid[targetcol][targetrow].ckotimestart = t.getTime() ; grid[targetcol][targetrow].dispckotimestart = t.getTimeStr() ; } if ( t.getTime() > grid[targetcol][targetrow].ckotimefinish ) { grid[targetcol][targetrow].ckotimefinish = t.getTime(); grid[targetcol][targetrow].dispckotimefinish = t.getTimeStr() ; } } } } void findMaxhits() { for (int k = 0; k < cols; k++) { for (int l = starttime; l < finishtime; l++) { maxhits = max( grid[k][l].hits, maxhits ); maxredhits = max( grid[k][l].redhits, maxredhits ); maxbluehits = max( grid[k][l].bluehits, maxbluehits ); maxgreenhits = max( grid[k][l].greenhits, maxgreenhits ); } } }