KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > medor > expression > api > Comparator


1 /**
2  * MEDOR: Middleware Enabling Distributed Object Requests
3  *
4  * Copyright (C) 2001-2003 France Telecom R&D
5  * Contact: alexandre.lefebvre@rd.francetelecom.com
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  *
21  * Initial developers: M. Alia, A. Lefebvre
22  */

23
24 package org.objectweb.medor.expression.api;
25
26 /**
27  * This interface represents a mathematical comparator. Comparators are:
28  * > < <= >= !=. the 'evaluate' methods do the comparison betwwen
29  * different type of variables: int, char, boolean,...
30  *
31  * @author Sebastien Chassande-Barrioz
32  */

33 public interface Comparator
34         extends BinaryOperator {
35
36     /**
37      * This fonction evaluate the comaparison between two java Object ;
38      * @param op1 Object
39      * @param op2 Object
40      * @return true if the comparison is verified
41      */

42     boolean evaluate(Object JavaDoc op1, Object JavaDoc op2);
43
44     /**
45      * This fonction evaluate the comaparison between two numerics variables;
46      * @param op1 int
47      * @param op2 int
48      * @return true if the comparison is verified
49      */

50     boolean evaluate(int op1, int op2);
51
52     /**
53      * This fonction evaluate the comaparison between two numerics variables;
54      * @param op1 int
55      * @param op2 short
56      * @return true if the comparison is verified
57      */

58     boolean evaluate(int op1, short op2);
59
60     /**
61      * This fonction evaluate the comaparison between two numerics variables;
62      * @param op1 int
63      * @param op2 long
64      * @return true if the comparison is verified
65      */

66     boolean evaluate(int op1, long op2);
67
68     /**
69      * This fonction evaluate the comaparison between two numerics variables;
70      * @param op1 int
71      * @param op2 float
72      * @return true if the comparison is verified
73      */

74     boolean evaluate(int op1, float op2);
75
76     /**
77      * This fonction evaluate the comaparison between two numerics variables;
78      * @param op1 int
79      * @param op2 double
80      * @return true if the comparison is verified
81      */

82     boolean evaluate(int op1, double op2);
83
84     /**
85      * This fonction evaluate the comaparison between two floats variables;
86      * @param op1 float
87      * @param op2 float
88      * @return true if the comparison is verified
89      */

90     boolean evaluate(float op1, float op2);
91
92     /**
93      * This fonction evaluate the comaparison between two numerics variables;
94      * @param op1 float
95      * @param op2 short
96      * @return true if the comparison is verified
97      */

98     boolean evaluate(float op1, short op2);
99
100     /**
101      * This fonction evaluate the comaparison between two numerics variables;
102      * @param op1 float
103      * @param op2 int
104      * @return true if the comparison is verified
105      */

106     boolean evaluate(float op1, int op2);
107
108     /**
109      * This fonction evaluate the comaparison between two numerics variables;
110      * @param op1 float
111      * @param op2 long
112      * @return true if the comparison is verified
113      */

114     boolean evaluate(float op1, long op2);
115
116     /**
117      * This fonction evaluate the comaparison between two numerics variables;
118      * @param op1 float
119      * @param op2 double
120      * @return true if the comparison is verified
121      */

122     boolean evaluate(float op1, double op2);
123
124     /**
125      * This fonction evaluate the comaparison between two characters variable;
126      * @param op1 char
127      * @param op2 char
128      * @return true if the comparison is verified
129      */

130     boolean evaluate(char op1, char op2);
131
132     /**
133      * This fonction evaluate the comaparison between two long variable;
134      * @param op1 long
135      * @param op2 long
136      * @return true if the comparison is verified
137      */

138     boolean evaluate(long op1, long op2);
139
140     /**
141      * This fonction evaluate the comaparison between two numerics variables;
142      * @param op1 long
143      * @param op2 short
144      * @return true if the comparison is verified
145      */

146     boolean evaluate(long op1, short op2);
147
148     /**
149      * This fonction evaluate the comaparison between two numerics variables;
150      * @param op1 long
151      * @param op2 int
152      * @return true if the comparison is verified
153      */

154     boolean evaluate(long op1, int op2);
155
156     /**
157      * This fonction evaluate the comaparison between two numerics variables;
158      * @param op1 long
159      * @param op2 float
160      * @return true if the comparison is verified
161      */

162     boolean evaluate(long op1, float op2);
163
164     /**
165      * This fonction evaluate the comaparison between two numerics variables;
166      * @param op1 long
167      * @param op2 double
168      * @return true if the comparison is verified
169      */

170     boolean evaluate(long op1, double op2);
171
172     /**
173      * This fonction evaluate the comaparison between two double variable;
174      * @param op1 double
175      * @param op2 double
176      * @return true if the comparison is verified
177      */

178     boolean evaluate(double op1, double op2);
179
180     /**
181      * This fonction evaluate the comaparison between two numerics variables;
182      * @param op1 double
183      * @param op2 short
184      * @return true if the comparison is verified
185      */

186     boolean evaluate(double op1, short op2);
187
188     /**
189      * This fonction evaluate the comaparison between two numerics variables;
190      * @param op1 double
191      * @param op2 int
192      * @return true if the comparison is verified
193      */

194     boolean evaluate(double op1, int op2);
195
196     /**
197      * This fonction evaluate the comaparison between two numerics variables;
198      * @param op1 double
199      * @param op2 float
200      * @return true if the comparison is verified
201      */

202     boolean evaluate(double op1, float op2);
203
204     /**
205      * This fonction evaluate the comaparison between two numerics variables;
206      * @param op1 double
207      * @param op2 long
208      * @return true if the comparison is verified
209      */

210     boolean evaluate(double op1, long op2);
211
212     /**
213      * This fonction evaluate the comaparison between two string variable;
214      * @param op1 String
215      * @param op2 String
216      * @return true if the comparison is verified
217      */

218     boolean evaluate(String JavaDoc op1, String JavaDoc op2);
219
220     /**
221      * This fonction evaluate the comaparison between two boolean variable;
222      * @param op1 boolean
223      * @param op2 boolean
224      * @return true if the comparison is verified; in case of <, > compartor
225      * it always return false
226      */

227     boolean evaluate(boolean op1, boolean op2);
228
229 }
230
Popular Tags