1 55 56 package org.apache.commons.el; 57 58 import javax.servlet.jsp.el.ELException ; 59 import java.math.BigDecimal ; 60 import java.math.BigInteger ; 61 62 70 71 public abstract class RelationalOperator 72 extends BinaryOperator 73 { 74 75 80 public Object apply (Object pLeft, 81 Object pRight, 82 Logger pLogger) 83 throws ELException 84 { 85 return Coercions.applyRelationalOperator (pLeft, pRight, this, pLogger); 86 } 87 88 93 public abstract boolean apply (double pLeft, 94 double pRight 95 ); 96 97 102 public abstract boolean apply (long pLeft, 103 long pRight 104 ); 105 106 111 public abstract boolean apply (String pLeft, 112 String pRight 113 ); 114 115 117 118 121 public abstract boolean apply(BigDecimal pLeft, BigDecimal pRight); 122 123 125 128 public abstract boolean apply(BigInteger pLeft, BigInteger pRight); 129 130 132 133 138 protected boolean isLess(int val) { 139 if (val < 0) 140 return true; 141 else 142 return false; 143 } 144 145 150 protected boolean isEqual(int val) { 151 if (val == 0) 152 return true; 153 else 154 return false; 155 } 156 157 162 protected boolean isGreater(int val) { 163 if (val > 0) 164 return true; 165 else 166 return false; 167 } 168 } 169 | Popular Tags |