Clover Coverage Report
Coverage timestamp: Sa Aug 2 2008 13:56:27 CEST
../../../../../../img/srcFileCovDistChart4.png 82% of files have more coverage
12   90   8   2
4   32   0,67   6
6     1,33  
1    
 
  LogicalCheckExceptionList       Line # 29 12 8 40,9% 0.4090909
 
  (19)
 
1    /* $Id: LogicalCheckExceptionList.java,v 1.1 2008/07/26 07:58:29 m31 Exp $
2    *
3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
4    *
5    * Copyright 2000-2008, Michael Meyling <mime@qedeq.org>.
6    *
7    * "Hilbert II" is free software; you can redistribute
8    * it and/or modify it under the terms of the GNU General Public
9    * License as published by the Free Software Foundation; either
10    * version 2 of the License, or (at your option) any later version.
11    *
12    * This program is distributed in the hope that it will be useful,
13    * but WITHOUT ANY WARRANTY; without even the implied warranty of
14    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15    * GNU General Public License for more details.
16    */
17   
18    package org.qedeq.kernel.bo.logic.wf;
19   
20    import java.util.ArrayList;
21    import java.util.List;
22   
23    /**
24    * Type save {@link org.qedeq.kernel.bo.logic.wf.LogicalCheckException} list.
25    *
26    * @version $Revision: 1.1 $
27    * @author Michael Meyling
28    */
 
29    public class LogicalCheckExceptionList {
30   
31    /** List with parse exceptions. */
32    private final List exceptions = new ArrayList();
33   
34    /**
35    * Constructor.
36    */
 
37  1018 toggle public LogicalCheckExceptionList() {
38    }
39   
40    /**
41    * Add exception.
42    *
43    * @param e Exception to add.
44    */
 
45  131 toggle public void add(final LogicalCheckException e) {
46  131 exceptions.add(e);
47    }
48   
49    /**
50    * Get number of collected exceptions.
51    *
52    * @return Number of collected exceptions.
53    */
 
54  1028 toggle public int size() {
55  1028 return exceptions.size();
56    }
57   
58    /**
59    * Get <code>i</code>-th exception.
60    *
61    * @param i Starts with 0 and must be smaller than {@link #size()}.
62    * @return Wanted exception.
63    */
 
64  131 toggle public LogicalCheckException get(final int i) {
65  131 return (LogicalCheckException) exceptions.get(i);
66    }
67   
68    /**
69    * Contains this list any errors?
70    *
71    * @return Do I contain any errors?
72    */
 
73  105 toggle public boolean hasErrors() {
74  105 return size() > 0;
75    }
76   
 
77  0 toggle public String toString() {
78  0 final StringBuffer buffer = new StringBuffer();
79  0 for (int i = 0; i < size(); i++) {
80  0 if (i != 0) {
81  0 buffer.append("\n");
82    }
83  0 final LogicalCheckException e = get(i);
84  0 buffer.append(i).append(": ");
85  0 buffer.append(e.toString());
86    }
87  0 return buffer.toString();
88    }
89   
90    }