1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| |
16 |
| |
17 |
| |
18 |
| package org.qedeq.kernel.bo.module; |
19 |
| |
20 |
| |
21 |
| |
22 |
| |
23 |
| |
24 |
| |
25 |
| |
26 |
| |
27 |
| public final class MathematicalState { |
28 |
| |
29 |
| |
30 |
| public static final MathematicalState STATE_UNCHECKED |
31 |
| = new MathematicalState(MathematicalStateDescriptions.STATE_STRING_UNCHECKED, |
32 |
| false, MathematicalStateDescriptions.STATE_CODE_UNCHECKED); |
33 |
| |
34 |
| |
35 |
| public static final MathematicalState STATE_EXTERNAL_CHECKING |
36 |
| = new MathematicalState(MathematicalStateDescriptions.STATE_STRING_EXTERNAL_CHECKING, |
37 |
| false, MathematicalStateDescriptions.STATE_CODE_EXTERNAL_CHECKING); |
38 |
| |
39 |
| |
40 |
| public static final MathematicalState STATE_EXTERNAL_CHECK_FAILED |
41 |
| = new MathematicalState(MathematicalStateDescriptions.STATE_STRING_EXTERNAL_CHECK_FAILED, |
42 |
| true, MathematicalStateDescriptions.STATE_CODE_EXTERNAL_CHECK_FAILED); |
43 |
| |
44 |
| |
45 |
| public static final MathematicalState STATE_INTERNAL_CHECKING |
46 |
| = new MathematicalState(MathematicalStateDescriptions.STATE_STRING_INTERNAL_CHECKING, |
47 |
| false, MathematicalStateDescriptions.STATE_CODE_INTERNAL_CHECKING); |
48 |
| |
49 |
| |
50 |
| public static final MathematicalState STATE_INTERNAL_CHECK_FAILED |
51 |
| = new MathematicalState(MathematicalStateDescriptions.STATE_STRING_INTERNAL_CHECK_FAILED, |
52 |
| true, MathematicalStateDescriptions.STATE_CODE_INTERNAL_CHECK_FAILED); |
53 |
| |
54 |
| |
55 |
| |
56 |
| public static final MathematicalState STATE_CHECKED |
57 |
| = new MathematicalState(MathematicalStateDescriptions.STATE_STRING_COMPLETELY_CHECKED, |
58 |
| false, MathematicalStateDescriptions.STATE_CODE_COMPLETELY_CHECKED); |
59 |
| |
60 |
| |
61 |
| |
62 |
| private final String text; |
63 |
| |
64 |
| |
65 |
| private final boolean failure; |
66 |
| |
67 |
| |
68 |
| private final int code; |
69 |
| |
70 |
| |
71 |
| |
72 |
| |
73 |
| |
74 |
| |
75 |
| |
76 |
| |
77 |
| |
78 |
0
| private MathematicalState(final String text, final boolean failure, final int code) {
|
79 |
0
| this.text = text;
|
80 |
0
| if (this.text == null) {
|
81 |
0
| throw new IllegalArgumentException("text==null");
|
82 |
| } |
83 |
0
| this.failure = failure;
|
84 |
0
| this.code = code;
|
85 |
| } |
86 |
| |
87 |
| |
88 |
| |
89 |
| |
90 |
| |
91 |
| |
92 |
0
| public final String getText() {
|
93 |
0
| return this.text;
|
94 |
| } |
95 |
| |
96 |
| |
97 |
| |
98 |
| |
99 |
| |
100 |
| |
101 |
0
| public final boolean isFailure() {
|
102 |
0
| return this.failure;
|
103 |
| } |
104 |
| |
105 |
| |
106 |
| |
107 |
| |
108 |
| |
109 |
| |
110 |
0
| public final int getCode() {
|
111 |
0
| return this.code;
|
112 |
| } |
113 |
| |
114 |
| |
115 |
| |
116 |
| |
117 |
0
| public final String toString() {
|
118 |
0
| return this.text;
|
119 |
| } |
120 |
| |
121 |
| |
122 |
| |
123 |
| |
124 |
0
| public final int hashCode() {
|
125 |
0
| return this.text.hashCode();
|
126 |
| } |
127 |
| |
128 |
| |
129 |
| |
130 |
| |
131 |
0
| public final boolean equals(final Object obj) {
|
132 |
0
| if (obj == null || !(obj instanceof MathematicalState)) {
|
133 |
0
| return false;
|
134 |
| } |
135 |
0
| return text.equals(((MathematicalState) obj).text);
|
136 |
| } |
137 |
| |
138 |
| } |