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 [TermVo.java]

nameclass, %method, %block, %line, %
TermVo.java100% (1/1)100% (7/7)100% (48/48)100% (16/16)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TermVo100% (1/1)100% (7/7)100% (48/48)100% (16/16)
TermVo (): void 100% (1/1)100% (3/3)100% (2/2)
TermVo (Element): void 100% (1/1)100% (6/6)100% (3/3)
equals (Object): boolean 100% (1/1)100% (14/14)100% (4/4)
getElement (): Element 100% (1/1)100% (3/3)100% (1/1)
hashCode (): int 100% (1/1)100% (9/9)100% (1/1)
setElement (Element): void 100% (1/1)100% (4/4)100% (2/2)
toString (): String 100% (1/1)100% (9/9)100% (3/3)

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.qedeq.base.utility.EqualsUtility;
19import org.qedeq.kernel.se.base.list.Element;
20import org.qedeq.kernel.se.base.module.Term;
21 
22 
23/**
24 * Wraps a term. Such an object is build out of
25 * {@link org.qedeq.kernel.se.base.list.Element}s.
26 *
27 * @author  Michael Meyling
28 */
29public class TermVo implements Term {
30 
31    /** Formula or term. */
32    private Element element;
33 
34    /**
35     * Constructs a term.
36     *
37     * @param   element    Element that should be a term.
38     */
39    public TermVo(final Element element) {
40        this.element = element;
41    }
42 
43    /**
44     * Empty constructor.
45     */
46    public TermVo() {
47        // nothing to do
48    }
49 
50    /**
51     * Set term.
52     *
53     * @param   element Term.
54     */
55    public final void setElement(final Element element) {
56        this.element = element;
57    }
58 
59    public final Element getElement() {
60        return element;
61    }
62 
63    public boolean equals(final Object obj) {
64        if (!(obj instanceof TermVo)) {
65            return false;
66        }
67        final TermVo other = (TermVo) obj;
68        return EqualsUtility.equals(getElement(), other.getElement());
69    }
70 
71    public int hashCode() {
72        return (getElement() != null ? getElement().hashCode() : 0);
73    }
74 
75    public String toString() {
76        if (getElement() != null) {
77            return getElement().toString();
78        }
79        return "";
80    }
81 
82}

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