-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDataChar.java
59 lines (48 loc) · 1.56 KB
/
DataChar.java
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Implementation for Accessing Data Item of type char
//
public class DataChar extends Data {
// Implementation for getting the data type
public String Type() {
return "char";
}
// Implementation for getting the size of the data type
public Integer Size() {
return 1;
}
// Implementation for getting the value of the data item
public Character Get() {
return ( Character )value;
}
// Implementation for setting the value of the data item
public void Set( Object v ) {
value = ( Character ) v;
}
// Implementation for string representation of the data item
public String AsString() {
return String.valueOf( ( Character ) value );
}
// Implementation for equal operator for data type
public boolean EQ( Object v ) {
return ( Character ) value == ( ( DataChar ) v ).Get();
}
// Implementation for not equal operator for data type
public boolean NE( Object v ) {
return ( Character ) value != ( ( DataChar ) v ).Get();
}
// Implementation for less than operator for data type
public boolean LT( Object v ) {
return ( Character ) value < ( ( DataChar ) v ).Get();
}
// Implementation for greater than operator for data type
public boolean GT( Object v ) {
return ( Character ) value > ( ( DataChar ) v ).Get();
}
// Implementation for less than or equal operator for data type
public boolean LE( Object v ) {
return ( Character ) value <= ( ( DataChar ) v ).Get();
}
// Implementation for greater than or equal operator for data type
public boolean GE( Object v ) {
return ( Character ) value >= ( ( DataChar ) v ).Get();
}
}