Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart7.png 74% of files have more coverage
20   150   12   1.67
0   50   0.6   12
12     1  
1    
 
  ProofLineData       Line # 24 20 12 68.8% 0.6875
 
  (9)
 
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.service.unicode;
17   
18   
19    /**
20    * Contains printing data for a formal proof line.
21    *
22    * @author Michael Meyling
23    */
 
24    public class ProofLineData {
25   
26    /** Current Label of formal proof line. */
27    private String lineLabel;
28   
29    /** String representation of formal proof line formula. */
30    private String[] formula;
31   
32    /** String representation of formal proof line reason. */
33    private String[] reason;
34   
35    /**
36    * Constructs empty container.
37    */
 
38  17 toggle public ProofLineData() {
39  17 init();
40    }
41   
42    /**
43    * Construct new proof line data.
44    *
45    * @param lineLabel Proof line label.
46    * @param formula Formula strings.
47    * @param reason Reason strings.
48    */
 
49  0 toggle public ProofLineData(final String lineLabel, final String[] formula, final String[] reason) {
50  0 this.lineLabel = lineLabel;
51  0 this.formula = formula;
52  0 this.reason = reason;
53    }
54   
55    /**
56    * Copy constructor.
57    *
58    * @param lineData Existing object.
59    */
 
60  0 toggle public ProofLineData(final ProofLineData lineData) {
61  0 this.lineLabel = lineData.lineLabel;
62  0 this.formula = new String[lineData.formula.length];
63  0 System.arraycopy(lineData.formula, 0, this.formula, 0, lineData.formula.length);
64  0 this.reason = new String[lineData.reason.length];
65  0 System.arraycopy(lineData.reason, 0, this.reason, 0, lineData.reason.length);
66    }
67   
68    /**
69    * Empty data.
70    */
 
71  2189 toggle public void init() {
72  2189 this.lineLabel = "";
73  2189 this.formula = new String[0];
74  2189 this.reason = new String[0];
75    }
76   
77    /**
78    * Exists formula data or reason data?
79    *
80    * @return Is there any reason or formula data?
81    */
 
82  1136 toggle public boolean containsData() {
83  1136 return (0 != lines());
84    }
85   
86    /**
87    * How many lines do we have? This is maximum of formula lines and reason lines.
88    *
89    * @return Number of lines.
90    */
 
91  3330 toggle public int lines() {
92  3330 return Math.max(getFormula().length, getReason().length);
93    }
94   
95    /**
96    * Get label for proof line.
97    *
98    * @return Proof line label.
99    */
 
100  2072 toggle public String getLineLabel() {
101  2072 return lineLabel;
102    }
103   
104    /**
105    * Set label for proof line.
106    *
107    * @param lineLabel Proof line label.
108    */
 
109  1036 toggle public void setLineLabel(final String lineLabel) {
110  1036 this.lineLabel = lineLabel;
111    }
112   
113    /**
114    * Get proof line formula.
115    *
116    * @return Proof line formula.
117    */
 
118  5646 toggle public String[] getFormula() {
119  5646 return formula;
120    }
121   
122    /**
123    * Set proof line formula.
124    *
125    * @param formula Proof line formula.
126    */
 
127  1036 toggle public void setFormula(final String[] formula) {
128  1036 this.formula = formula;
129    }
130   
131    /**
132    * Get derive reason for proof line. Already formatted in several lines.
133    *
134    * @return Reason for getting this proof line.
135    */
 
136  5528 toggle public String[] getReason() {
137  5528 return reason;
138    }
139   
140    /**
141    * Set derive reason for proof line.
142    *
143    * @param reason Reason for getting this proof line. Must be already formatted in serveral
144    * lines.
145    */
 
146  1872 toggle public void setReason(final String[] reason) {
147  1872 this.reason = reason;
148    }
149   
150    }