1 11 package org.eclipse.jdt.internal.debug.eval.ast.instructions; 12 13 import org.eclipse.jdt.debug.core.IJavaPrimitiveValue; 14 import org.eclipse.jdt.debug.core.IJavaValue; 15 16 public class MultiplyOperator extends BinaryOperator { 17 public MultiplyOperator(int resultId, int leftTypeId, int rightTypeId, int start) { 18 this(resultId, leftTypeId, rightTypeId, false, start); 19 } 20 21 protected MultiplyOperator(int resultId, int leftTypeId, int rightTypeId, boolean isAssignmentOperator, int start) { 22 super(resultId, leftTypeId, rightTypeId, isAssignmentOperator, start); 23 } 24 25 28 protected boolean getBooleanResult(IJavaValue leftOperand, IJavaValue rightOperand) { 29 return false; 30 } 31 32 35 protected double getDoubleResult(IJavaValue leftOperand, IJavaValue rightOperand) { 36 return ((IJavaPrimitiveValue) leftOperand).getDoubleValue() * ((IJavaPrimitiveValue) rightOperand).getDoubleValue(); 37 } 38 39 42 protected float getFloatResult(IJavaValue leftOperand, IJavaValue rightOperand) { 43 return ((IJavaPrimitiveValue) leftOperand).getFloatValue() * ((IJavaPrimitiveValue) rightOperand).getFloatValue(); 44 } 45 46 49 protected int getIntResult(IJavaValue leftOperand, IJavaValue rightOperand) { 50 return ((IJavaPrimitiveValue) leftOperand).getIntValue() * ((IJavaPrimitiveValue) rightOperand).getIntValue(); 51 } 52 53 56 protected long getLongResult(IJavaValue leftOperand, IJavaValue rightOperand) { 57 return ((IJavaPrimitiveValue) leftOperand).getLongValue() * ((IJavaPrimitiveValue) rightOperand).getLongValue(); 58 } 59 60 63 protected String getStringResult(IJavaValue leftOperand, IJavaValue rightOperand) { 64 return null; 65 } 66 67 public String toString() { 68 return InstructionsEvaluationMessages.MultiplyOperator______operator_1; 69 } 70 71 } 72 | Popular Tags |