KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > piaget > analyze > WMAnalyzer


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

6
7 package org.netbeans.modules.piaget.analyze;
8
9 import java.util.HashSet JavaDoc;
10 import java.util.Iterator JavaDoc;
11 import java.io.File JavaDoc;
12 import org.netbeans.modules.piagetproject.property.Property;
13
14 /**
15  *
16  * @author loicsegapelli
17  */

18 public class WMAnalyzer extends WMParser{
19     
20     HashSet JavaDoc names;
21     
22     /** Creates a new instance of WMAnalyzer */
23     public WMAnalyzer(File JavaDoc f) {
24         super(f);
25     }
26     
27     protected void init(){
28         names=new HashSet JavaDoc();
29     }
30     
31     protected void eof(){
32         Iterator JavaDoc it=names.iterator();
33         if(!it.hasNext()){
34            return;
35         }
36         Analyzer.writeComment("Magnified Top Components:");
37         while(it.hasNext()){
38             String JavaDoc name = (String JavaDoc)it.next();
39             Analyzer.writeComment(" * "+name);
40             Analyzer.writeProperty(Property.MAGNIFIED+name, name);
41         }
42     }
43     
44     protected void analyzeMax(String JavaDoc s){
45         names.add((Object JavaDoc)s);
46     }
47     
48 }
49
Popular Tags