View Javadoc

    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;
    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      public VariableUsageFinderFunction(Map decls) {
    17          this.decls = decls;
    18      }
    19
    20      public void applyTo(Object o) {
    21          results.put(o, decls.get(o));
    22      }
    23
    24      public Map getUsed() {
    25          return results;
    26      }
    27  }