1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19public
20class Nat0
21 implements Ordering <Nat0>
22{
23
24
25
26 protected
27 long n;
28
29
30
31
32 public
33 Nat0() {
34 n = 0;
35 }
36
37 public
38 Nat0(long n) {
39 assert n >= 0 : "negative argument";
40
41 this.n = n;
42 }
43
44 public
45 Nat0(int n) {
46 this((long)n);
47 }
48
49
50
51
52 public
53 int intValue() {
54 return
55 (int)n;
56 }
57
58 public
59 long longValue() {
60 return n;
61 }
62
63
64
65
66
67
68 public
69 boolean eq(Nat0 o2)
70 {
71 return n == o2.n;
72 }
73
74 public
75 boolean ge(Nat0 o2)
76 {
77 return n >= o2.n;
78 }
79
80 public
81 boolean gr(Nat0 o2)
82 {
83 return n > o2.n;
84 }
85
86 public
87 boolean ne(Nat0 o2) {
88 return ! eq(o2);
89 }
90
91 public
92 boolean le(Nat0 o2) {
93 return ! gr(o2);
94 }
95
96 public
97 boolean lt(Nat0 o2) {
98 return ! ge(o2);
99 }
100}
101
102