EMMA Coverage Report (generated Wed Jun 27 17:43:42 CEST 2012)
[all classes][aarddict.android]

COVERAGE SUMMARY FOR SOURCE FILE [SectionMatcher.java]

nameclass, %method, %block, %line, %
SectionMatcher.java100% (1/1)33%  (1/3)5%   (3/60)22%  (2/9)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SectionMatcher100% (1/1)33%  (1/3)5%   (3/60)22%  (2/9)
getNumberOfComparators (): int 0%   (0/1)0%   (0/3)0%   (0/1)
match (String, String, int): boolean 0%   (0/1)0%   (0/54)0%   (0/6)
SectionMatcher (): void 100% (1/1)100% (3/3)100% (2/2)

1/* This file is part of Aard Dictionary for Android <http://aarddict.org>.
2 * 
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 3
5 * as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 * GNU General Public License <http://www.gnu.org/licenses/gpl-3.0.txt>
11 * for more details.
12 * 
13 * Copyright (C) 2010 Igor Tkach
14*/
15 
16package aarddict.android;
17 
18import java.util.Comparator;
19 
20import aarddict.Entry;
21import aarddict.EntryComparators;
22import android.util.Log;
23 
24 
25final class SectionMatcher {
26    
27    final static String TAG = "aarddict.SectionMatcher";
28        
29    public SectionMatcher() {
30    }
31    
32    public boolean match(String section, String candidate, int strength) {        
33        Comparator<Entry> c = EntryComparators.ALL[strength];
34        Entry e1 = new Entry(null, section.trim());
35        Entry e2 = new Entry(null, candidate.trim());
36        boolean result = c.compare(e1, e2) == 0;
37        Log.d(TAG, String.format("Match section <%s> candidate <%s> strength <%s> match? %s", section, candidate, strength, result));
38        return result;
39    }                
40 
41    public int getNumberOfComparators() {
42        return EntryComparators.ALL.length;
43    }
44}

[all classes][aarddict.android]
EMMA 0.0.0 (unsupported private build) (C) Vladimir Roubtsov