KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > analyzer > listeners > WMAnalyzer


1 /*
2  * WMAnalyzer.java
3  *
4  * Created on April 24, 2005, 11:08 PM
5  */

6
7 package analyzer.listeners;
8
9 import java.util.HashSet JavaDoc;
10 import java.util.Iterator JavaDoc;
11
12 /**
13  *
14  * @author loicsegapelli
15  */

16 public class WMAnalyzer extends WMParser{
17     
18     HashSet JavaDoc names;
19     
20     /** Creates a new instance of WMAnalyzer */
21     public WMAnalyzer(String JavaDoc pathAndTS) {
22         super(pathAndTS);
23     }
24     
25     protected void init(){
26         names=new HashSet JavaDoc();
27     }
28     
29     protected void eof(){
30         Iterator JavaDoc it=names.iterator();
31         if(!it.hasNext()){
32            System.out.println("nothing");
33            return;
34         }
35         System.out.println("***WM\nMagnified: ");
36         while(it.hasNext()) System.out.println(" + "+(String JavaDoc)it.next());
37         System.out.println("***");
38     }
39     
40     protected void analyzeMax(String JavaDoc s){
41         names.add((Object JavaDoc)s);
42     }
43     
44 }
45
Popular Tags