1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.universAAL.middleware.owl;
20
21
22
23
24
25
26
27
28
29
30
31
32
33 public abstract class ComparableIndividual extends ManagedIndividual implements
34 Comparable {
35
36
37
38
39
40 public static final int NON_COMPARABLE_INDIVIDUALS = Integer.MAX_VALUE;
41
42 public static final String MY_URI = uAAL_VOCABULARY_NAMESPACE
43 + "ComparableIndividual";
44
45 protected ComparableIndividual() {
46 super();
47 }
48
49 protected ComparableIndividual(String uri) {
50 super(uri);
51 }
52
53 public String getClassURI() {
54 return MY_URI;
55 }
56
57 public static final ComparableIndividual getClassMaximum(Class claz) {
58
59 try {
60 return (ComparableIndividual) claz.getMethod("getMaximum",
61 (Class[]) null).invoke(null, (Object[]) null);
62 } catch (Exception e) {
63 return null;
64 }
65 }
66
67 public static final ComparableIndividual getClassMinimum(Class claz) {
68
69 try {
70 return (ComparableIndividual) claz.getMethod("getMinimum",
71 (Class[]) null).invoke(null, (Object[]) null);
72 } catch (Exception e) {
73 return null;
74 }
75 }
76
77
78
79
80 public static ComparableIndividual getMaximum() {
81 return null;
82 }
83
84
85
86
87 public static ComparableIndividual getMinimum() {
88 return null;
89 }
90
91
92
93
94
95
96
97
98
99
100
101
102
103 public abstract int compareTo(Object arg0);
104
105 public final ComparableIndividual getClassMaximum() {
106 try {
107 return (ComparableIndividual) this.getClass()
108 .getMethod("getMaximum", (Class[]) null)
109 .invoke(null, (Object[]) null);
110 } catch (Exception e) {
111 return null;
112 }
113 }
114
115 public final ComparableIndividual getClassMinimum() {
116 try {
117 return (ComparableIndividual) this.getClass()
118 .getMethod("getMinimum", (Class[]) null)
119 .invoke(null, (Object[]) null);
120 } catch (Exception e) {
121 return null;
122 }
123 }
124
125
126
127
128
129
130
131 public abstract ComparableIndividual getNext();
132
133
134
135
136
137
138
139 public abstract ComparableIndividual getPrevious();
140
141
142 public final boolean equal(Object other) {
143 try {
144 return compareTo(other) == 0;
145 } catch (Exception e) {
146 return false;
147 }
148 }
149
150
151 public final boolean greater(Object other) {
152 try {
153 return compareTo(other) == 1;
154 } catch (Exception e) {
155 return false;
156 }
157 }
158
159
160 public final boolean greaterEqual(Object other) {
161 try {
162 switch (compareTo(other)) {
163 case 0:
164 case 1:
165 return true;
166 default:
167 return false;
168 }
169 } catch (Exception e) {
170 return false;
171 }
172 }
173
174
175 public final boolean less(Object other) {
176 try {
177 return compareTo(other) == -1;
178 } catch (Exception e) {
179 return false;
180 }
181 }
182
183
184 public final boolean lessEqual(Object other) {
185 try {
186 switch (compareTo(other)) {
187 case 0:
188 case -1:
189 return true;
190 default:
191 return false;
192 }
193 } catch (Exception e) {
194 return false;
195 }
196 }
197
198
199
200
201
202
203 public abstract int ord();
204
205 }