EMMA Coverage Report (generated Fri Feb 14 08:28:31 UTC 2014)
[all classes][org.qedeq.kernel.se.dto.module]

COVERAGE SUMMARY FOR SOURCE FILE [AddVo.java]

nameclass, %method, %block, %line, %
AddVo.java100% (1/1)100% (10/10)100% (83/83)100% (25/25)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AddVo100% (1/1)100% (10/10)100% (83/83)100% (25/25)
AddVo (): void 100% (1/1)100% (3/3)100% (2/2)
AddVo (String): void 100% (1/1)100% (6/6)100% (3/3)
equals (Object): boolean 100% (1/1)100% (14/14)100% (4/4)
getAdd (): Add 100% (1/1)100% (2/2)100% (1/1)
getName (): String 100% (1/1)100% (2/2)100% (1/1)
getReference (): String 100% (1/1)100% (3/3)100% (1/1)
getReferences (): String [] 100% (1/1)100% (13/13)100% (3/3)
hashCode (): int 100% (1/1)100% (9/9)100% (1/1)
setReference (String): void 100% (1/1)100% (4/4)100% (2/2)
toString (): String 100% (1/1)100% (27/27)100% (7/7)

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.se.dto.module;
17 
18import org.apache.commons.lang.ArrayUtils;
19import org.qedeq.base.utility.EqualsUtility;
20import org.qedeq.kernel.se.base.module.Add;
21 
22 
23/**
24 * Usage of formula addition.
25 *
26 * @author  Michael Meyling
27 */
28public class AddVo implements Add {
29 
30    /** Reference to previously proven formula. */
31    private String reference;
32 
33    /**
34     * Constructs an addition argument.
35     *
36     * @param   reference  Reference to a valid formula.
37     */
38    public AddVo(final String reference) {
39        this.reference = reference;
40    }
41 
42    /**
43     * Default constructor.
44     */
45    public AddVo() {
46        // nothing to do
47    }
48 
49    public Add getAdd() {
50        return this;
51    }
52 
53    public String getReference() {
54        return reference;
55    }
56 
57    /**
58     * Set formula reference.
59     *
60     * @param   reference   Reference to formula. Might be <code>null</code>.
61     */
62    public void setReference(final String reference) {
63        this.reference = reference;
64    }
65 
66    public String[] getReferences() {
67        if (reference == null) {
68            return ArrayUtils.EMPTY_STRING_ARRAY;
69        }
70        return new String[] {reference };
71    }
72 
73    public boolean equals(final Object obj) {
74        if (!(obj instanceof AddVo)) {
75            return false;
76        }
77        final AddVo other = (AddVo) obj;
78        return  EqualsUtility.equals(reference, other.reference);
79    }
80 
81    public int hashCode() {
82        return (reference != null ? reference.hashCode() : 0);
83    }
84 
85    public String toString() {
86        StringBuffer result = new StringBuffer();
87        result.append("Add");
88        if (reference != null) {
89            result.append(" (");
90            result.append(reference);
91            result.append(")");
92        }
93        return result.toString();
94    }
95 
96    public String getName() {
97        return "Add";
98    }
99 
100}

[all classes][org.qedeq.kernel.se.dto.module]
EMMA 2.1.5320 (stable) (C) Vladimir Roubtsov