-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyBoolean.java
More file actions
45 lines (36 loc) · 841 Bytes
/
Copy pathMyBoolean.java
File metadata and controls
45 lines (36 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package data;
public class MyBoolean implements BasicType {
private Boolean value;
public MyBoolean(){
value = false;
}
public MyBoolean(Boolean b){
value = b;
}
public void not(){
value = !value;
}
public String getValue(){
return "BOOL";
}
public int hashCode(){
return value.hashCode();
}
public boolean equals(Object o){
if (this == o) return true;
if (o == null) return false;
if (getClass() != o.getClass()) return false;
MyBoolean b = (MyBoolean) o;
return value.equals(b.getValue());
}
public int compareTo(Value o) {
// TODO Auto-generated method stub
int classCompare = getClass().getName().compareTo(o.getClass().getName());
if (classCompare != 0) return classCompare;
//MyBoolean b = (MyBoolean) o;
return 0;
}
public String toString(){
return value.toString();
}
}