KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
37  *
38  * @author Sebastien Chassande-Barrioz
39  */

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