1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.qedeq.kernel.se.dto.module;
17
18 import org.qedeq.base.utility.EqualsUtility;
19 import org.qedeq.kernel.se.base.module.LatexList;
20 import org.qedeq.kernel.se.base.module.Node;
21 import org.qedeq.kernel.se.base.module.Subsection;
22
23
24
25
26
27
28
29 public class SubsectionVo implements Subsection {
30
31
32 private String id;
33
34
35 private String level;
36
37
38 private LatexList title;
39
40
41 private LatexList latex;
42
43
44
45
46 public SubsectionVo() {
47
48 }
49
50 public Node getNode() {
51 return null;
52 }
53
54 public Subsection getSubsection() {
55 return this;
56 }
57
58
59
60
61
62
63 public final void setId(final String label) {
64 this.id = label;
65 }
66
67 public final String getId() {
68 return id;
69 }
70
71
72
73
74
75
76 public final void setLevel(final String level) {
77 this.level = level;
78 }
79
80 public final String getLevel() {
81 return level;
82 }
83
84
85
86
87
88
89 public final void setTitle(final LatexListVo title) {
90 this.title = title;
91 }
92
93 public final LatexList getTitle() {
94 return title;
95 }
96
97
98
99
100
101
102 public final void setLatex(final LatexListVo latexText) {
103 this.latex = latexText;
104 }
105
106 public final LatexList getLatex() {
107 return latex;
108 }
109
110 public boolean equals(final Object obj) {
111 if (!(obj instanceof SubsectionVo)) {
112 return false;
113 }
114 final SubsectionVo subsection = (SubsectionVo) obj;
115 return EqualsUtility.equals(getId(), subsection.getId())
116 && EqualsUtility.equals(getLevel(), subsection.getLevel())
117 && EqualsUtility.equals(getTitle(), subsection.getTitle())
118 && EqualsUtility.equals(getLatex(), subsection.getLatex());
119 }
120
121 public int hashCode() {
122 return (getId() != null ? getId().hashCode() : 0)
123 ^ (getLevel() != null ? 1 ^ getLevel().hashCode() : 0)
124 ^ (getTitle() != null ? 2 ^ getTitle().hashCode() : 0)
125 ^ (getLatex() != null ? 3 ^ getLatex().hashCode() : 0);
126 }
127
128 public String toString() {
129 final StringBuffer buffer = new StringBuffer();
130 buffer.append("Subsection\t");
131 buffer.append("Label: " + getId());
132 buffer.append("\tLevel: " + getLevel() + "\n");
133 buffer.append("Title: ");
134 buffer.append(getTitle() + "\n\n");
135 buffer.append("Pre: ");
136 buffer.append(getLatex() + "\n\n");
137 return buffer.toString();
138 }
139
140 }