Clover coverage report - PMD - 3.9 Coverage timestamp: Tue Dec 19 2006 09:38:44 EST FRAMES NO FRAMES |
file stats: | LOC: | 35 |  | Methods: | 4
| NCLOC: | 24 |  | Classes: | 1
Source file | Conditionals | Statements | Methods | TOTAL
ImageFinderFunction.java | 100% | 100% | 100% | 100% |

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.HashSet;
9 |  | import java.util.List;
10 |  | import java.util.Set;
11 |  |
12 |  | public class ImageFinderFunction implements UnaryFunction {
13 |  |
14 |  | private Set images = new HashSet();
15 |  | private NameDeclaration decl;
16 |  |
17 | 7062 | public ImageFinderFunction(String img) {
18 | 7062 | images.add(img);
19 |  | }
20 |  |
21 | 886 | public ImageFinderFunction(List imageList) {
22 | 886 | images.addAll(imageList);
23 |  | }
24 |  |
25 | 7465 | public void applyTo(Object o) {
26 | 7465 | NameDeclaration nameDeclaration = (NameDeclaration) o;
27 | 7465 | if (images.contains(nameDeclaration.getImage())) {
28 | 3420 | decl = nameDeclaration;
29 |  | }
30 |  | }
31 |  |
32 | 7948 | public NameDeclaration getDecl() {
33 | 7948 | return this.decl;
34 |  | }
35 |  | }