1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19public
20class Nat1
21 extends AbstractOrdering <Nat1>
22{
23
24
25
26 protected
27 long n;
28
29
30
31
32 public
33 Nat1() {
34 n = 1;
35 }
36
37 public
38 Nat1(long n) {
39 assert n >= 1 : "argument <= 0";
40 this.n = n;
41 }
42
43 public
44 Nat1(int n) {
45 this((long)n);
46 }
47
48
49
50
51 public
52 int intValue() {
53 return
54 (int)n;
55 }
56
57 public
58 long longValue() {
59 return n;
60 }
61
62
63
64
65
66
67 public
68 boolean eq(Nat1 o2)
69 {
70 return n == o2.n;
71 }
72
73 public
74 boolean ge(Nat1 o2)
75 {
76 return n >= o2.n;
77 }
78}
79
80