Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart5.png 87% of files have more coverage
10   106   7   1.43
0   34   0.7   7
7     1  
1    
 
  Function       Line # 23 10 7 41.2% 0.4117647
 
  (2)
 
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    * One function for our model.
20    *
21    * @author Michael Meyling
22    */
 
23    public abstract class Function {
24   
25   
26    /** Minimum number of arguments this function has. */
27    private final int minimum;
28   
29    /** Maximum number of arguments this function has. */
30    private final int maximum;
31   
32    /** Display text. */
33    private final String display;
34   
35    /** Description for this function. */
36    private final String description;
37   
 
38  0 toggle static Function createConstant(final Entity entity) {
39  0 return new Function(0, 90, "->" + entity, "contant " + entity.getDescription()) {
 
40  348 toggle public Entity map(final Entity[] entities) {
41  348 return entity;
42    }
43    };
44    }
45   
46    /**
47    * Constructor.
48    *
49    * @param minimum Minimum number of arguments this function has.
50    * @param maximum Maximum number of arguments this function has.
51    * @param display Show this to represent the function within outputs.
52    * @param description Description for this function.
53    */
 
54  826 toggle public Function(final int minimum, final int maximum, final String display,
55    final String description) {
56  826 this.minimum = minimum;
57  826 this.maximum = maximum;
58  826 this.display = display;
59  826 this.description = description;
60    }
61   
62    /**
63    * Get minimum number of arguments this function has.
64    *
65    * @return Minimum number of arguments for this function.
66    */
 
67  0 toggle public int getMinimumArgumentNumber() {
68  0 return minimum;
69    }
70   
71    /**
72    * Get maximum number of arguments this function has.
73    *
74    * @return Maximum number of arguments for this function.
75    */
 
76  0 toggle public int getMaximumArgumentNumber() {
77  0 return maximum;
78    }
79   
80    /**
81    * Get display text.
82    *
83    * @return Representation of this function for textual output.
84    */
 
85  0 toggle public String toString() {
86  0 return display;
87    }
88   
89    /**
90    * Get description.
91    *
92    * @return Description of this function.
93    */
 
94  0 toggle public String getDescription() {
95  0 return description;
96    }
97   
98    /**
99    * Calculate truth value.
100    *
101    * @param entities Calculate function for this entities.
102    * @return Truth value.
103    */
104    public abstract Entity map(Entity[] entities);
105   
106    }