KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > pmd > symboltable > VariableUsageFinderFunction


1 /**
2  * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3  */

4 package net.sourceforge.pmd.symboltable;
5
6 import net.sourceforge.pmd.util.UnaryFunction;
7
8 import java.util.HashMap JavaDoc;
9 import java.util.Map JavaDoc;
10
11 public class VariableUsageFinderFunction implements UnaryFunction {
12
13     private Map JavaDoc results = new HashMap JavaDoc();
14     private Map JavaDoc decls;
15
16     public VariableUsageFinderFunction(Map JavaDoc decls) {
17         this.decls = decls;
18     }
19
20     public void applyTo(Object JavaDoc o) {
21         results.put(o, decls.get(o));
22     }
23
24     public Map JavaDoc getUsed() {
25         return results;
26     }
27 }
28
Popular Tags