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

nameclass, %method, %block, %line, %
QedeqVo.java100% (1/1)100% (11/11)100% (134/134)100% (25/25)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class QedeqVo100% (1/1)100% (11/11)100% (134/134)100% (25/25)
QedeqVo (): void 100% (1/1)100% (3/3)100% (2/2)
addChapter (ChapterVo): void 100% (1/1)100% (13/13)100% (4/4)
equals (Object): boolean 100% (1/1)100% (30/30)100% (4/4)
getChapterList (): ChapterList 100% (1/1)100% (3/3)100% (1/1)
getHeader (): Header 100% (1/1)100% (3/3)100% (1/1)
getLiteratureItemList (): LiteratureItemList 100% (1/1)100% (3/3)100% (1/1)
hashCode (): int 100% (1/1)100% (31/31)100% (1/1)
setChapterList (ChapterListVo): void 100% (1/1)100% (4/4)100% (2/2)
setHeader (HeaderVo): void 100% (1/1)100% (4/4)100% (2/2)
setLiteratureItemList (LiteratureItemListVo): void 100% (1/1)100% (4/4)100% (2/2)
toString (): String 100% (1/1)100% (36/36)100% (5/5)

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.module.ChapterList;
20import org.qedeq.kernel.se.base.module.Header;
21import org.qedeq.kernel.se.base.module.LiteratureItemList;
22import org.qedeq.kernel.se.base.module.Qedeq;
23 
24 
25/**
26 * A complete QEDEQ module. This is the root value object.
27 *
28 * @author    Michael Meyling
29 */
30public class QedeqVo implements Qedeq {
31 
32    /** Header of module. */
33    private Header header;
34 
35    /** All module chapters. */
36    private ChapterListVo chapterList;
37 
38    /** Bibliography. */
39    private LiteratureItemList literatureItemList;
40 
41    /**
42     * Constructs a new empty qedeq module.
43     */
44    public QedeqVo() {
45        // nothing to do
46    }
47 
48    /**
49     * Set header for this module.
50     *
51     * @param   header  Module header.
52     */
53    public final void setHeader(final HeaderVo header) {
54        this.header = header;
55    }
56 
57    public final Header getHeader() {
58        return header;
59    }
60 
61    /**
62     * Set chapter list of this module.
63     *
64     * @param   chapters    Chapter list.
65     */
66    public final void setChapterList(final ChapterListVo chapters) {
67        this.chapterList = chapters;
68    }
69 
70    public final ChapterList getChapterList() {
71        return chapterList;
72    }
73 
74    /**
75     * Add chapter to this module.
76     *
77     * @param   chapter Chapter to add.
78     */
79    public final void addChapter(final ChapterVo chapter) {
80        if (chapterList == null) {
81            chapterList = new ChapterListVo();
82        }
83        chapterList.add(chapter);
84    }
85 
86    public LiteratureItemList getLiteratureItemList() {
87        return literatureItemList;
88    }
89 
90    /**
91     * Set bibliography.
92     *
93     * @param   literatureItemList  Bibliography.
94     */
95    public void setLiteratureItemList(final LiteratureItemListVo literatureItemList) {
96        this.literatureItemList = literatureItemList;
97    }
98 
99    public boolean equals(final Object obj) {
100        if (!(obj instanceof QedeqVo)) {
101            return false;
102        }
103        final QedeqVo other = (QedeqVo) obj;
104        return  EqualsUtility.equals(getHeader(), other.getHeader())
105            &&  EqualsUtility.equals(getChapterList(), other.getChapterList())
106            &&  EqualsUtility.equals(getLiteratureItemList(), other.getLiteratureItemList());
107    }
108 
109    public int hashCode() {
110        return (getHeader() != null ? getHeader().hashCode() : 0)
111            ^ (getChapterList() != null ? 1 ^ getChapterList().hashCode() : 0)
112            ^ (getLiteratureItemList() != null ? 2 ^ getLiteratureItemList().hashCode() : 0);
113    }
114 
115    public String toString() {
116        final StringBuffer buffer = new StringBuffer();
117        buffer.append(getHeader() + "\n\n");
118        buffer.append(getChapterList() + "\n\n");
119        buffer.append(getLiteratureItemList());
120        return buffer.toString();
121    }
122 
123}

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