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 GreaterOperator extends BinaryOperator { 17 public GreaterOperator(int leftTypeId, int rightTypeId, int start) { 18 super(T_boolean, leftTypeId, rightTypeId, false, start); 19 } 20 21 24 protected boolean getBooleanResult(IJavaValue leftOperand, IJavaValue rightOperand) { 25 switch (getInternResultType()) { 26 case T_double : 27 return ((IJavaPrimitiveValue) leftOperand).getDoubleValue() > ((IJavaPrimitiveValue) rightOperand).getDoubleValue(); 28 case T_float : 29 return ((IJavaPrimitiveValue) leftOperand).getFloatValue() > ((IJavaPrimitiveValue) rightOperand).getFloatValue(); 30 case T_long : 31 return ((IJavaPrimitiveValue) leftOperand).getLongValue() > ((IJavaPrimitiveValue) rightOperand).getLongValue(); 32 case T_int : 33 return ((IJavaPrimitiveValue) leftOperand).getIntValue() > ((IJavaPrimitiveValue) rightOperand).getIntValue(); 34 default : 35 return false; 36 } 37 } 38 39 42 protected double getDoubleResult(IJavaValue leftOperand, IJavaValue rightOperand) { 43 return 0; 44 } 45 46 49 protected float getFloatResult(IJavaValue leftOperand, IJavaValue rightOperand) { 50 return 0; 51 } 52 53 56 protected int getIntResult(IJavaValue leftOperand, IJavaValue rightOperand) { 57 return 0; 58 } 59 60 63 protected long getLongResult(IJavaValue leftOperand, IJavaValue rightOperand) { 64 return 0; 65 } 66 67 70 protected String getStringResult(IJavaValue leftOperand, IJavaValue rightOperand) { 71 return null; 72 } 73 74 public String toString() { 75 return InstructionsEvaluationMessages.GreaterOperator______operator_1; 76 } 77 78 } 79 | Popular Tags |