1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| |
16 |
| |
17 |
| |
18 |
| package org.qedeq.kernel.dto.module; |
19 |
| |
20 |
| import org.qedeq.kernel.base.module.Chapter; |
21 |
| import org.qedeq.kernel.base.module.LatexList; |
22 |
| import org.qedeq.kernel.base.module.SectionList; |
23 |
| import org.qedeq.kernel.utility.EqualsUtility; |
24 |
| |
25 |
| |
26 |
| |
27 |
| |
28 |
| |
29 |
| |
30 |
| |
31 |
| |
32 |
| public class ChapterVo implements Chapter { |
33 |
| |
34 |
| |
35 |
| private LatexList title; |
36 |
| |
37 |
| |
38 |
| private Boolean noNumber; |
39 |
| |
40 |
| |
41 |
| private LatexList introduction; |
42 |
| |
43 |
| |
44 |
| private SectionListVo sectionList; |
45 |
| |
46 |
| |
47 |
| |
48 |
| |
49 |
344
| public ChapterVo() {
|
50 |
| |
51 |
| } |
52 |
| |
53 |
| |
54 |
| |
55 |
| |
56 |
| |
57 |
| |
58 |
236
| public final void setNoNumber(final Boolean noNumber) {
|
59 |
236
| this.noNumber = noNumber;
|
60 |
| } |
61 |
| |
62 |
994
| public final Boolean getNoNumber() {
|
63 |
994
| return noNumber;
|
64 |
| } |
65 |
| |
66 |
| |
67 |
| |
68 |
| |
69 |
| |
70 |
| |
71 |
319
| public final void setTitle(final LatexListVo title) {
|
72 |
319
| this.title = title;
|
73 |
| } |
74 |
| |
75 |
240776
| public final LatexList getTitle() {
|
76 |
240776
| return title;
|
77 |
| } |
78 |
| |
79 |
| |
80 |
| |
81 |
| |
82 |
| |
83 |
| |
84 |
313
| public final void setIntroduction(final LatexListVo introduction) {
|
85 |
313
| this.introduction = introduction;
|
86 |
| } |
87 |
| |
88 |
240234
| public final LatexList getIntroduction() {
|
89 |
240234
| return introduction;
|
90 |
| } |
91 |
| |
92 |
| |
93 |
| |
94 |
| |
95 |
| |
96 |
| |
97 |
130
| public final void setSectionList(final SectionListVo sections) {
|
98 |
130
| this.sectionList = sections;
|
99 |
| } |
100 |
| |
101 |
208583
| public final SectionList getSectionList() {
|
102 |
208583
| return sectionList;
|
103 |
| } |
104 |
| |
105 |
| |
106 |
| |
107 |
| |
108 |
| |
109 |
| |
110 |
265
| public final void addSection(final SectionVo section) {
|
111 |
265
| if (sectionList == null) {
|
112 |
94
| sectionList = new SectionListVo();
|
113 |
| } |
114 |
265
| sectionList.add(section);
|
115 |
| } |
116 |
| |
117 |
158
| public boolean equals(final Object obj) {
|
118 |
158
| if (!(obj instanceof ChapterVo)) {
|
119 |
10
| return false;
|
120 |
| } |
121 |
148
| final ChapterVo other = (ChapterVo) obj;
|
122 |
148
| return EqualsUtility.equals(getNoNumber(), other.getNoNumber())
|
123 |
| && EqualsUtility.equals(getTitle(), other.getTitle()) |
124 |
| && EqualsUtility.equals(getIntroduction(), other.getIntroduction()) |
125 |
| && EqualsUtility.equals(getSectionList(), other.getSectionList()); |
126 |
| } |
127 |
| |
128 |
130
| public int hashCode() {
|
129 |
130
| return (getNoNumber() != null ? getNoNumber().hashCode() : 0)
|
130 |
130
| ^ (getTitle() != null ? getTitle().hashCode() : 0)
|
131 |
130
| ^ (getIntroduction() != null ? 1 ^ getIntroduction().hashCode() : 0)
|
132 |
130
| ^ (getSectionList() != null ? 2 ^ getSectionList().hashCode() : 0);
|
133 |
| } |
134 |
| |
135 |
105
| public String toString() {
|
136 |
105
| final StringBuffer buffer = new StringBuffer();
|
137 |
105
| buffer.append("Chapter noNumber: " + getNoNumber() + "\n");
|
138 |
105
| buffer.append("Chapter Title:\n");
|
139 |
105
| buffer.append(getTitle() + "\n\n");
|
140 |
105
| buffer.append("Introduction:\n");
|
141 |
105
| buffer.append(getIntroduction() + "\n\n");
|
142 |
105
| buffer.append(getSectionList() + "\n");
|
143 |
105
| return buffer.toString();
|
144 |
| } |
145 |
| |
146 |
| } |