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 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 evaluate(BigDecimal op1, BigDecimal op2) { 155 BigDecimal result = op1.subtract(op2); 156 return result; 157 } 158 159 public BigInteger evaluate(BigInteger op1, BigInteger op2) { 160 BigInteger result = op1.subtract(op2); 161 return result; 162 } 163 164 public String evaluate(char op1, String op2) throws TypingException { 165 throw new TypingException("Minus(String, String)"); 166 } 167 168 public String evaluate(String op1, String op2) throws TypingException { 169 throw new TypingException("Minus(String, String)"); 170 } 171 172 public Time evaluate(Time op1, Time op2) throws TypingException { 173 throw new TypingException("Minus(Time, Time)"); 174 } 175 176 public Timestamp evaluate(Timestamp op1, Timestamp op2) 177 throws TypingException { 178 throw new TypingException("Minus(Timestamp, Timestamp)"); 179 } 180 181 public Date evaluate(Date op1, Date op2) throws TypingException { 182 throw new TypingException("Minus(Date, Date)"); 183 } 184 185 public String evaluate(String op1, char op2) throws TypingException { 186 throw new TypingException("Minus(String, char)"); 187 } 188 189 public String getOperatorString() { 190 return Operator.MINUS; 191 } 192 193 } 194 | Popular Tags |