EMMA Coverage Report (generated Fri Feb 14 08:28:31 UTC 2014)
[all classes][org.qedeq.kernel.bo.logic]

COVERAGE SUMMARY FOR SOURCE FILE [ProofCheckerFactoryImpl.java]

nameclass, %method, %block, %line, %
ProofCheckerFactoryImpl.java100% (1/1)100% (3/3)68%  (41/60)63%  (12/19)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ProofCheckerFactoryImpl100% (1/1)100% (3/3)68%  (41/60)63%  (12/19)
createProofChecker (Version): ProofChecker 100% (1/1)57%  (16/28)57%  (4/7)
isRuleVersionSupported (String): boolean 100% (1/1)76%  (22/29)64%  (7/11)
ProofCheckerFactoryImpl (): void 100% (1/1)100% (3/3)100% (1/1)

1/* This file is part of the project "Hilbert II" - http://www.qedeq.org
2 *
3 * Copyright 2000-2014,  Michael Meyling <mime@qedeq.org>.
4 *
5 * "Hilbert II" is free software; you can redistribute
6 * it and/or modify it under the terms of the GNU General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15 
16package org.qedeq.kernel.bo.logic;
17 
18import org.qedeq.base.io.Version;
19import org.qedeq.kernel.bo.logic.proof.checker.ProofChecker0Impl;
20import org.qedeq.kernel.bo.logic.proof.checker.ProofChecker1Impl;
21import org.qedeq.kernel.bo.logic.proof.checker.ProofChecker2Impl;
22import org.qedeq.kernel.bo.logic.proof.common.ProofChecker;
23import org.qedeq.kernel.bo.logic.proof.common.ProofCheckerFactory;
24 
25 
26 
27/**
28 * Factory implementation for {@link ProofChecker}s.
29 *
30 * @author  Michael Meyling
31 */
32public class ProofCheckerFactoryImpl implements ProofCheckerFactory {
33 
34    public boolean isRuleVersionSupported(final String ruleVersion) {
35        try {
36            new Version(ruleVersion);
37        } catch (RuntimeException e) {
38            return false;
39        }
40        if ("0.00.00".equals(ruleVersion)) {
41            return true;
42        } else if ("0.01.00".equals(ruleVersion)) {
43            return true;
44        } else if ("0.02.00".equals(ruleVersion)) {
45            return true;
46        }
47        return false;
48    }
49 
50    public ProofChecker createProofChecker(final Version ruleVersion) {
51        if (ruleVersion.equals("0.00.00")) {
52            return new ProofChecker0Impl();
53        } else if (ruleVersion.equals("0.01.00")) {
54            return new ProofChecker1Impl();
55        } else if (ruleVersion.equals("0.02.00")) {
56            return new ProofChecker2Impl();
57        }
58        // not found, so we take the best one we have
59        return new ProofChecker2Impl();
60    }
61 
62 
63}

[all classes][org.qedeq.kernel.bo.logic]
EMMA 2.1.5320 (stable) (C) Vladimir Roubtsov