1 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 ; 31 import java.math.BigInteger ; 32 import java.sql.Time ; 33 import java.sql.Timestamp ; 34 import java.util.Date ; 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 evaluate(BigDecimal op1, BigDecimal op2) { 151 BigDecimal result = op1.multiply(op2); 152 return result; 153 } 154 155 public BigInteger evaluate(BigInteger op1, BigInteger op2) { 156 BigInteger result = op1.multiply(op2); 157 return result; 158 } 159 160 public String evaluate(String op1, String op2) throws TypingException { 161 throw new TypingException("Mult(String, String)"); 162 } 163 164 public String evaluate(String op1, char op2) throws TypingException { 165 throw new TypingException("Mult(String, char)"); 166 } 167 168 public String evaluate(char op1, String op2) throws TypingException { 169 throw new TypingException("Mult(char, String)"); 170 } 171 172 public Timestamp evaluate(Timestamp op1, Timestamp op2) 173 throws TypingException { 174 throw new TypingException("Mult(Timestamp, Timestamp)"); 175 } 176 177 public Time evaluate(Time op1, Time op2) throws TypingException { 178 throw new TypingException("Mult(Time, Time)"); 179 } 180 181 public Date evaluate(Date op1, Date op2) throws TypingException { 182 throw new TypingException("Mult(Date, Date)"); 183 } 184 185 public String getOperatorString() { 186 return Operator.MULT; 187 } 188 } 189 190 191 192 193 | Popular Tags |