Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../img/srcFileCovDistChart7.png 74% of files have more coverage
17   63   9   8.5
12   34   0.53   2
2     4.5  
1    
 
  ProofCheckerFactoryImpl       Line # 32 17 9 64.5% 0.6451613
 
  (8)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2013, 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   
16    package org.qedeq.kernel.bo.logic;
17   
18    import org.qedeq.base.io.Version;
19    import org.qedeq.kernel.bo.logic.proof.checker.ProofChecker0Impl;
20    import org.qedeq.kernel.bo.logic.proof.checker.ProofChecker1Impl;
21    import org.qedeq.kernel.bo.logic.proof.checker.ProofChecker2Impl;
22    import org.qedeq.kernel.bo.logic.proof.common.ProofChecker;
23    import 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    */
 
32    public class ProofCheckerFactoryImpl implements ProofCheckerFactory {
33   
 
34  10 toggle public boolean isRuleVersionSupported(final String ruleVersion) {
35  10 try {
36  10 new Version(ruleVersion);
37    } catch (RuntimeException e) {
38  0 return false;
39    }
40  10 if ("0.00.00".equals(ruleVersion)) {
41  0 return true;
42  10 } else if ("0.01.00".equals(ruleVersion)) {
43  9 return true;
44  1 } else if ("0.02.00".equals(ruleVersion)) {
45  1 return true;
46    }
47  0 return false;
48    }
49   
 
50  1 toggle public ProofChecker createProofChecker(final Version ruleVersion) {
51  1 if (ruleVersion.equals("0.00.00")) {
52  0 return new ProofChecker0Impl();
53  1 } else if (ruleVersion.equals("0.01.00")) {
54  0 return new ProofChecker1Impl();
55  1 } else if (ruleVersion.equals("0.02.00")) {
56  0 return new ProofChecker2Impl();
57    }
58    // not found, so we take the best one we have
59  1 return new ProofChecker2Impl();
60    }
61   
62   
63    }