KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > analyzer > listeners > DOCAnalyzer


1 /*
2  * DOCAnalyzer.java
3  *
4  * Created on May 6, 2005, 5:03 PM
5  */

6
7 package analyzer.listeners;
8
9 /**
10  *
11  * @author loicsegapelli
12  */

13 public class DOCAnalyzer extends DOCParser{
14     
15     double frequency;
16     long totalTime;
17     /** Creates a new instance of DOCAnalyzer */
18     public DOCAnalyzer(String JavaDoc pathAndTS) {
19         super(pathAndTS);
20     }
21     
22     protected void eof(){
23         if(frequency==-1)System.out.println("nothing found");
24         else System.out.println("freq:"+frequency+" time:"+prettyTime(totalTime));
25     }
26     
27     protected void init(){
28         frequency=totalTime=-1;
29     }
30     
31     protected void analyzeValues(double freq,long time){
32         frequency=freq;
33         totalTime=time;
34     }
35 }
36
Popular Tags