KickJava   Java API By Example, From Geeks To Geeks.

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


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 import java.util.Date JavaDoc;
27
28 /**
29  * This interface represents a binary arithmetic operation (+, -, ...).
30  * <p>
31  * It gives methods for a binary evaluation with all valid cases.
32  * These binary evaluate methods are called by the generic
33  * evaluate(ParameterOperand[], Object) method, depending on the types of the
34  * left and right Operands.
35  *
36  * @author Sebastien Chassande-Barrioz
37  */

38 public interface BinaryArithmeticOperator extends BinaryOperator {
39
40     /**
41      * This fonction evaluate the arithmetic operation between two numerics
42      * variables;
43      * @param op1 integer
44      * @param op2 integer
45      * @return an integer result
46      */

47     int evaluate(int op1, int op2);
48
49     /**
50      * This fonction evaluate the comaparison between two numerics variables;
51      * @param op1 int
52      * @param op2 short
53      * @return an int as in Java programming language
54      */

55     int evaluate(int op1, short op2);
56
57     /**
58      * This fonction evaluate the comaparison between two numerics variables;
59      * @param op1 int
60      * @param op2 long
61      * @return a long result as in Java programming language
62      */

63     long evaluate(int op1, long op2);
64
65     /**
66      * This fonction evaluate the comaparison between two numerics variables;
67      * @param op1 int
68      * @param op2 float
69      * @return a float result as in Java programming language
70      */

71     float evaluate(int op1, float op2);
72
73     /**
74      * This fonction evaluate the comaparison between two numerics variables;
75      * @param op1 int
76      * @param op2 double
77      * @return a double as in Java programming language
78      */

79     double evaluate(int op1, double op2);
80
81     /**
82      * This fonction evaluate the comaparison between two floats variables;
83      * @param op1 float
84      * @param op2 float
85      * @return a float resultas in Java programming language
86      */

87     float evaluate(float op1, float op2);
88
89     /**
90      * This fonction evaluate the comaparison between two numerics variables;
91      * @param op1 float
92      * @param op2 short
93      * @return a float result as in Java programming language
94      */

95     float evaluate(float op1, short op2);
96
97     /**
98      * This fonction evaluate the comaparison between two numerics variables;
99      * @param op1 float
100      * @param op2 int
101      * @return a float result as in Java programming language
102      */

103     float evaluate(float op1, int op2);
104
105     /**
106      * This fonction evaluate the comaparison between two numerics variables;
107      * @param op1 float
108      * @param op2 long
109      * @return a float result as in Java programming language
110      */

111     float evaluate(float op1, long op2);
112
113     /**
114      * This fonction evaluate the comaparison between two numerics variables;
115      * @param op1 float
116      * @param op2 double
117      * @return a double result as in Java programming language
118      */

119     double evaluate(float op1, double op2);
120
121     /**
122      * This fonction evaluate the comaparison between two characters variable;
123      * @param op1 character
124      * @param op2 character
125      * @return an int value
126      */

127     int evaluate(char op1, char op2) throws TypingException;
128
129
130     /**
131      * This fonction evaluate the comaparison between two characters variable;
132      * @param op1 char
133      * @param op2 string
134      * @return a string value
135      * @throws TypingException if this operation is not supported
136      */

137     String JavaDoc evaluate(char op1, String JavaDoc op2)throws TypingException;
138
139
140     /**
141      * This fonction evaluate the comaparison between two long variable;
142      * @param op1 long
143      * @param op2 long
144      * @return a long result as in Java programming language
145      */

146     long evaluate(long op1, long op2);
147
148     /**
149      * This fonction evaluate the comaparison between two numerics variables;
150      * @param op1 long
151      * @param op2 short
152      * @return a long result as in Java programming language
153      */

154     long evaluate(long op1, short op2);
155
156     /**
157      * This fonction evaluate the comaparison between two numerics variables;
158      * @param op1 long
159      * @param op2 int
160      * @return a long result as in Java programming language
161      */

162     long evaluate(long op1, int op2);
163
164     /**
165      * This fonction evaluate the comaparison between two numerics variables;
166      * @param op1 long
167      * @param op2 float
168      * @return a float result as in Java programming language
169      */

170     float evaluate(long op1, float op2);
171
172     /**
173      * This fonction evaluate the comaparison between two numerics variables;
174      * @param op1 long
175      * @param op2 double
176      * @return a double result as in Java programming language
177      */

178     double evaluate(long op1, double op2);
179
180     /**
181      * This fonction evaluate the comaparison between two double variable;
182      * @param op1 double
183      * @param op2 double
184      * @return a double result as in Java programming language
185      */

186     double evaluate(double op1, double op2);
187
188     /**
189      * This fonction evaluate the comaparison between two numerics variables;
190      * @param op1 double
191      * @param op2 short
192      * @return a double result as in Java programming language
193      */

194     double evaluate(double op1, short op2);
195
196     /**
197      * This fonction evaluate the comaparison between two numerics variables;
198      * @param op1 double
199      * @param op2 int
200      * @return a double result as in Java programming language
201      */

202     double evaluate(double op1, int op2);
203
204     /**
205      * This fonction evaluate the comaparison between two numerics variables;
206      * @param op1 double
207      * @param op2 float
208      * @return a double result as in Java programming language
209      */

210     double evaluate(double op1, float op2);
211
212     /**
213      * This fonction evaluate the comaparison between two numerics variables;
214      * @param op1 double
215      * @param op2 long
216      * @return a double result as in Java programming language
217      */

218     double evaluate(double op1, long op2);
219
220     /**
221      * This fonction evaluate the comaparison between two string variable;
222      * @param op1 String
223      * @param op2 String
224      * @return a string value as in java programming language
225      * @throws TypingException if this operation is not supported
226      */

227     String JavaDoc evaluate(String JavaDoc op1, String JavaDoc op2)throws TypingException;
228
229     /**
230      * This fonction evaluate the comaparison between two string variable;
231      * @param op1 String
232      * @param op2 char
233      * @return a string value as in java programming language
234      * @throws TypingException if this operation is not supported
235      */

236     String JavaDoc evaluate(String JavaDoc op1, char op2)throws TypingException;
237
238     /**
239      * This fonction evaluate the comaparison between two java.util.Date variable;
240      * @param op1 Date
241      * @param op2 Date
242      * @return a Date value as in java programming language
243      * @throws TypingException if this operation is not supported
244      */

245     Date JavaDoc evaluate(Date JavaDoc op1, Date JavaDoc op2)throws TypingException;
246 }
247
Popular Tags