1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18import java.util.Vector;
19
20
21
22public
23class List
24 extends Vector
25 implements Ordering
26{
27
28
29
30 public
31 List() {
32 super();
33 }
34
35
36
37
38
39 public
40 boolean eq(Object v2) {
41 List
42 l2 = (List)v2;
43
44 if ( elementCount != l2.elementCount )
45
46 return
47 false;
48
49 for(int i = 0;
50 i < elementCount;
51 ++i) {
52
53 Ordering
54 e1 = (Ordering)(elementAt(i));
55
56 if ( e1.ne(l2.elementAt(i)) )
57
58 return
59 false;
60 }
61
62
63 return
64 true;
65 }
66
67
68
69
70 public
71 boolean ge(Object v2) {
72 List l2 = (List)v2;
73
74 int len1 = elementCount;
75 int len2 = l2.elementCount;
76
77 for(int i = 0; ; ++i) {
78 if ( i == len2 )
79 return
80 true;
81
82 if ( i == len1 )
83 return
84 false;
85
86
87 {
88 Ordering
89 e1 = (Ordering)(elementAt(i));
90
91 Object
92 e2 = l2.elementAt(i);
93
94 if ( e1.ne(e2) )
95
96 return
97 e1.ge(e2);
98
99
100 }
101 }
102 }
103
104
105
106
107
108
109 public
110 boolean ne(Object v2) {
111 return
112 ! eq(v2);
113 }
114
115 public
116 boolean gr(Object v2) {
117 return
118 ge(v2) && ! eq(v2);
119 }
120
121 public
122 boolean le(Object v2) {
123 return
124 ! gr(v2);
125 }
126
127 public
128 boolean lt(Object v2) {
129 return
130 ! ge(v2);
131 }
132
133}
134
135