KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > medor > expression > lib > Mult


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.lib;
25
26 import org.objectweb.medor.expression.api.Expression;
27 import org.objectweb.medor.expression.api.Operator;
28 import org.objectweb.medor.expression.api.TypingException;
29
30 import java.math.BigDecimal JavaDoc;
31 import java.math.BigInteger JavaDoc;
32 import java.sql.Time JavaDoc;
33 import java.sql.Timestamp JavaDoc;
34 import java.util.Date JavaDoc;
35
36 public class Mult extends BasicBinaryArithmeticOperator {
37
38     public Mult() {
39     }
40
41     public Mult(Expression l, Expression r) {
42         super(l, r);
43     }
44
45     public int evaluate(int op1, int op2) {
46         int result = op1 * op2;
47         return result;
48     }
49
50     public int evaluate(int op1, short op2) {
51         int result = op1 * op2;
52         return result;
53     }
54
55     public long evaluate(int op1, long op2) {
56         long result = op1 * op2;
57         return result;
58     }
59
60     public float evaluate(int op1, float op2) {
61         float result = op1 * op2;
62         return result;
63     }
64
65     public double evaluate(int op1, double op2) {
66         double result = op1 * op2;
67         return result;
68     }
69
70     public float evaluate(float op1, float op2) {
71         float result = op1 * op2;
72         return result;
73     }
74
75     public float evaluate(float op1, short op2) {
76         float result = op1 * op2;
77         return result;
78     }
79
80     public float evaluate(float op1, int op2) {
81         float result = op1 * op2;
82         return result;
83     }
84
85     public float evaluate(float op1, long op2) {
86         float result = op1 * op2;
87         return result;
88     }
89
90     public double evaluate(float op1, double op2) {
91         double result = op1 * op2;
92         return result;
93     }
94
95     public int evaluate(char op1, char op2) {
96         int result = op1 * op2;
97         return result;
98     }
99
100     public long evaluate(long op1, long op2) {
101         long result = op1 * op2;
102         return result;
103     }
104
105     public long evaluate(long op1, short op2) {
106         long result = op1 * op2;
107         return result;
108     }
109
110     public long evaluate(long op1, int op2) {
111         long result = op1 * op2;
112         return result;
113     }
114
115     public float evaluate(long op1, float op2) {
116         float result = op1 * op2;
117         return result;
118     }
119
120     public double evaluate(long op1, double op2) {
121         double result = op1 * op2;
122         return result;
123     }
124
125     public double evaluate(double op1, double op2) {
126         double result = op1 * op2;
127         return result;
128     }
129
130     public double evaluate(double op1, short op2) {
131         double result = op1 * op2;
132         return result;
133     }
134
135     public double evaluate(double op1, int op2) {
136         double result = op1 * op2;
137         return result;
138     }
139
140     public double evaluate(double op1, float op2) {
141         double result = op1 * op2;
142         return result;
143     }
144
145     public double evaluate(double op1, long op2) {
146         double result = op1 * op2;
147         return result;
148     }
149
150     public BigDecimal JavaDoc evaluate(BigDecimal JavaDoc op1, BigDecimal JavaDoc op2) {
151         BigDecimal JavaDoc result = op1.multiply(op2);
152         return result;
153     }
154
155     public BigInteger JavaDoc evaluate(BigInteger JavaDoc op1, BigInteger JavaDoc op2) {
156         BigInteger JavaDoc result = op1.multiply(op2);
157         return result;
158     }
159
160     public String JavaDoc evaluate(String JavaDoc op1, String JavaDoc op2) throws TypingException {
161         throw new TypingException("Mult(String, String)");
162     }
163
164     public String JavaDoc evaluate(String JavaDoc op1, char op2) throws TypingException {
165         throw new TypingException("Mult(String, char)");
166     }
167
168     public String JavaDoc evaluate(char op1, String JavaDoc op2) throws TypingException {
169         throw new TypingException("Mult(char, String)");
170     }
171
172     public Timestamp JavaDoc evaluate(Timestamp JavaDoc op1, Timestamp JavaDoc op2)
173             throws TypingException {
174         throw new TypingException("Mult(Timestamp, Timestamp)");
175     }
176
177     public Time JavaDoc evaluate(Time JavaDoc op1, Time JavaDoc op2) throws TypingException {
178         throw new TypingException("Mult(Time, Time)");
179     }
180
181     public Date JavaDoc evaluate(Date JavaDoc op1, Date JavaDoc op2) throws TypingException {
182         throw new TypingException("Mult(Date, Date)");
183     }
184
185     public String JavaDoc getOperatorString() {
186         return Operator.MULT;
187     }
188 }
189
190
191
192
193
Popular Tags