Clover coverage report - PMD - 3.7
Coverage timestamp: Wed May 31 2006 09:25:59 EDT

file stats: | LOC: | 38 |  | Methods: | 5
| NCLOC: | 26 |  | Classes: | 2

Source file | Conditionals | Statements | Methods | TOTAL

AnyLanguage.java

-

33.3%

20%

27.3%

1 |  | /**
2 |  | * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3 |  | */
4 |  | package net.sourceforge.pmd.cpd;
5 |  |
6 |  | import java.io.File;
7 |  | import java.io.FilenameFilter;
8 |  |
9 |  | public class AnyLanguage implements Language {
10 |  |
11 |  | public static class AnyFileOrDirectoryFilter implements FilenameFilter {
12 |  | String extension;
13 |  |
14 | 0 | public AnyFileOrDirectoryFilter(String extension) {
15 | 0 | this.extension = extension;
16 |  | }
17 |  |
18 | 0 | public boolean accept(File dir, String filename) {
19 | 0 | return filename.endsWith(extension) || (new File(dir.getAbsolutePath() + System.getProperty("file.separator") + filename).isDirectory());
20 |  | }
21 |  | }
22 |  |
23 |  | private AnyTokenizer tokenizer;
24 |  | private String extension;
25 |  |
26 | 1 | public AnyLanguage(String extension) {
27 | 1 | this.extension = extension;
28 | 1 | tokenizer = new AnyTokenizer();
29 |  | }
30 |  |
31 | 0 | public Tokenizer getTokenizer() {
32 | 0 | return tokenizer;
33 |  | }
34 |  |
35 | 0 | public FilenameFilter getFileFilter() {
36 | 0 | return new AnyFileOrDirectoryFilter(this.extension);
37 |  | }
38 |  | }