EMMA Coverage Report (generated Fri Feb 14 08:28:31 UTC 2014)
[all classes][org.qedeq.kernel.bo.logic.common]

COVERAGE SUMMARY FOR SOURCE FILE [LogicalCheckExceptionList.java]

nameclass, %method, %block, %line, %
LogicalCheckExceptionList.java100% (1/1)86%  (6/7)49%  (36/74)54%  (9.7/18)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class LogicalCheckExceptionList100% (1/1)86%  (6/7)49%  (36/74)54%  (9.7/18)
toString (): String 0%   (0/1)0%   (0/36)0%   (0/8)
hasErrors (): boolean 100% (1/1)71%  (5/7)71%  (0.7/1)
LogicalCheckExceptionList (): void 100% (1/1)100% (8/8)100% (3/3)
add (LogicalCheckException): void 100% (1/1)100% (6/6)100% (2/2)
add (LogicalCheckExceptionList): void 100% (1/1)100% (7/7)100% (2/2)
get (int): LogicalCheckException 100% (1/1)100% (6/6)100% (1/1)
size (): int 100% (1/1)100% (4/4)100% (1/1)

1/* This file is part of the project "Hilbert II" - http://www.qedeq.org
2 *
3 * Copyright 2000-2014,  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 
16package org.qedeq.kernel.bo.logic.common;
17 
18import java.util.ArrayList;
19import java.util.List;
20 
21/**
22 * Type save {@link org.qedeq.kernel.bo.logic.common.LogicalCheckException} list.
23 *
24 * @author  Michael Meyling
25 */
26public class LogicalCheckExceptionList {
27 
28    /** List with parse exceptions. */
29    private final List exceptions = new ArrayList();
30 
31    /**
32     * Constructor.
33     */
34    public LogicalCheckExceptionList() {
35        // nothing to do
36    }
37 
38    /**
39     * Add exception.
40     *
41     * @param   e   Exception to add.
42     */
43    public void add(final LogicalCheckException e) {
44        exceptions.add(e);
45    }
46 
47    /**
48     * Add exceptions.
49     *
50     * @param   e   Exceptions to add.
51     */
52    public void add(final LogicalCheckExceptionList e) {
53        exceptions.addAll(e.exceptions);
54    }
55 
56    /**
57     * Get number of collected exceptions.
58     *
59     * @return  Number of collected exceptions.
60     */
61    public int size() {
62        return exceptions.size();
63    }
64 
65    /**
66     * Get <code>i</code>-th exception.
67     *
68     * @param   i   Starts with 0 and must be smaller than {@link #size()}.
69     * @return  Wanted exception.
70     */
71    public LogicalCheckException get(final int i) {
72        return (LogicalCheckException) exceptions.get(i);
73    }
74 
75    /**
76     * Contains this list any errors?
77     *
78     * @return  Do I contain any errors?
79     */
80    public boolean hasErrors() {
81        return size() > 0;
82    }
83 
84    public String toString() {
85        final StringBuffer buffer = new StringBuffer();
86        for (int i = 0; i < size(); i++) {
87            if (i != 0) {
88                buffer.append("\n");
89            }
90            final LogicalCheckException e = get(i);
91            buffer.append(i).append(": ");
92            buffer.append(e.toString());
93        }
94        return buffer.toString();
95    }
96 
97}

[all classes][org.qedeq.kernel.bo.logic.common]
EMMA 2.1.5320 (stable) (C) Vladimir Roubtsov