Clover Coverage Report
Coverage timestamp: Sat Sep 18 2010 04:09:52 UTC
../../../../../../img/srcFileCovDistChart4.png 84% of files have more coverage
12   87   8   2
4   32   0.67   6
6     1.33  
1    
 
  LogicalCheckExceptionList       Line # 26 12 8 40.9% 0.4090909
 
  (31)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2010, 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.wf;
17   
18    import java.util.ArrayList;
19    import java.util.List;
20   
21    /**
22    * Type save {@link org.qedeq.kernel.bo.logic.wf.LogicalCheckException} list.
23    *
24    * @author Michael Meyling
25    */
 
26    public class LogicalCheckExceptionList {
27   
28    /** List with parse exceptions. */
29    private final List exceptions = new ArrayList();
30   
31    /**
32    * Constructor.
33    */
 
34  1107 toggle public LogicalCheckExceptionList() {
35    }
36   
37    /**
38    * Add exception.
39    *
40    * @param e Exception to add.
41    */
 
42  132 toggle public void add(final LogicalCheckException e) {
43  132 exceptions.add(e);
44    }
45   
46    /**
47    * Get number of collected exceptions.
48    *
49    * @return Number of collected exceptions.
50    */
 
51  1118 toggle public int size() {
52  1118 return exceptions.size();
53    }
54   
55    /**
56    * Get <code>i</code>-th exception.
57    *
58    * @param i Starts with 0 and must be smaller than {@link #size()}.
59    * @return Wanted exception.
60    */
 
61  132 toggle public LogicalCheckException get(final int i) {
62  132 return (LogicalCheckException) exceptions.get(i);
63    }
64   
65    /**
66    * Contains this list any errors?
67    *
68    * @return Do I contain any errors?
69    */
 
70  105 toggle public boolean hasErrors() {
71  105 return size() > 0;
72    }
73   
 
74  0 toggle public String toString() {
75  0 final StringBuffer buffer = new StringBuffer();
76  0 for (int i = 0; i < size(); i++) {
77  0 if (i != 0) {
78  0 buffer.append("\n");
79    }
80  0 final LogicalCheckException e = get(i);
81  0 buffer.append(i).append(": ");
82  0 buffer.append(e.toString());
83    }
84  0 return buffer.toString();
85    }
86   
87    }