All pastes #800663 Raw Edit

Miscellany

public text v1 · immutable
#800663 ·published 2007-11-28 17:20 UTC
rendered paste body
      public void process( String logfile ) throws IOException
       {
    	   String SingleLine, band_name, record_name;
           Integer score=0;
    	   BufferedReader br_logfile;
           StringTokenizer Str_tok;
           
           // Read the log file into the buffer
           br_logfile = new BufferedReader( new FileReader(logfile));
           
           // Read first line from logfile
           SingleLine = br_logfile.readLine();
           
           // Loop until EOF
           while (SingleLine != null )
           {

        	   // Split the line
        	   Str_tok = new StringTokenizer(SingleLine,"/");

        	   // Extract the band's name and then find the label name
        	   band_name = Str_tok.nextToken();
        	   band_name = band_name.trim();
        	   record_name = bandToLabel.get(band_name);
        	   record_name = record_name.trim();

        	   // Get record score, increment it and put it back in the table
        	   score = scoreboard.get(record_name);
        	   if (score == null) score = 0;
        	   score = score++;
        	   scoreboard.put(record_name, score);

        	   // Read another line form logfile
        	   SingleLine = br_logfile.readLine();
           }
           }