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