Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart8.png 62% of files have more coverage
17   77   7   2.43
0   37   0.41   7
7     1  
1    
 
  UnaryDynamicModel       Line # 23 17 7 75% 0.75
 
  (3)
 
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.model;
17   
18    /**
19    * A model for our mathematical world. It has only one entity.
20    *
21    * @author Michael Meyling
22    */
 
23    public final class UnaryDynamicModel extends DynamicModel {
24   
25    /** "Zero" or empty class. */
26    public static final Entity ZERO = new Entity(0, "0", "{} or empty set");
27   
28    /** Map to zero. */
29    public static final Function FUNCTION_ZERO = new Function(0, 99, "->0", "always 0") {
 
30  6 toggle public Entity map(final Entity[] entities) {
31  6 return ZERO;
32    }
33    };
34   
35    /**
36    * Constructor.
37    */
 
38  47 toggle public UnaryDynamicModel() {
39  47 super("one element");
40  47 addEntity(ZERO);
41   
42    // we don't need to add functions because we always return FUNCTION_ZERO
43   
44  47 addPredicate(0, FALSE);
45  47 addPredicate(0, TRUE);
46  47 addPredicate(1, FALSE);
47  47 addPredicate(1, TRUE);
48  47 addPredicate(2, FALSE);
49  47 addPredicate(2, TRUE);
50  47 addPredicate(3, FALSE);
51  47 addPredicate(3, TRUE);
52   
53  47 addPredicateConstant(new ModelPredicateConstant("in", 2), FALSE);
54   
55    }
56   
 
57  0 toggle public String getDescription() {
58  0 return "This model has only one entity. The \" is element of\" relation is never fullfilled.";
59    }
60   
 
61  3 toggle public int getFunctionSize(final int size) {
62  3 return 1;
63    }
64   
 
65  6 toggle public Function getFunction(final int size, final int number) {
66  6 return FUNCTION_ZERO;
67    }
68   
 
69  0 toggle public Function getFunctionConstant(final ModelFunctionConstant con) {
70  0 return FUNCTION_ZERO;
71    }
72   
 
73  0 toggle public Entity comprehension(final Entity[] array) {
74  0 return ZERO;
75    }
76   
77    }