-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDataFloat.java
58 lines (48 loc) · 1.52 KB
/
DataFloat.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
// Implementation for Accessing Data Item of type Float
//
public class DataFloat extends Data {
// Implementation for getting the data type
public String Type() {
return "float";
}
// Implementation for getting the size of the data type
public Integer Size() {
return 4;
}
// Implementation for getting the value of the data item
public Float Get() {
return ( Float )value;
}
// Implementation for setting the value of the data item
public void Set( Object v ) {
value = (Float) v;
}
// Implementation for string representation of the data item
public String AsString() {
return String.valueOf( (Float) value );
}
// Implementation for equal operator for data type
public boolean EQ( Object v ) {
return ( Float ) value == ( ( DataFloat ) v ).Get();
}
// Implementation for not equal operator for data type
public boolean NE( Object v ) {
return ( Float ) value != ( ( DataFloat ) v ).Get();
}
// Implementation for less than operator for data type
public boolean LT( Object v ) {
return ( Float ) value < ( ( DataFloat ) v ).Get();
}
// Implementation for greater than operator for data type
public boolean GT( Object v ) {
return ( Float ) value > ( ( DataFloat ) v ).Get();
}
// Implementation for less than or equal operator for data type
public boolean LE( Object v ) {
return ( Float ) value <= ( ( DataFloat ) v ).Get();
}
// Implementation for greater than or equal operator for data type
public boolean GE( Object v ) {
return ( Float ) value >= ( ( DataFloat ) v ).Get();
}
}