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 69 70 public class PlusOperator 71 extends ArithmeticOperator 72 { 73 77 public static final PlusOperator SINGLETON = 78 new PlusOperator (); 79 80 85 public PlusOperator () 86 { 87 } 88 89 96 public String getOperatorSymbol () { 97 return "+"; 98 } 99 100 105 public double apply (double pLeft, double pRight) { 106 return pLeft + pRight; 107 } 108 109 114 public long apply (long pLeft, long pRight) { 115 return pLeft + pRight; 116 } 117 118 120 125 public BigDecimal apply(BigDecimal pLeft, BigDecimal pRight) { 126 return pLeft.add(pRight); 127 } 128 129 131 136 public BigInteger apply(BigInteger pLeft, BigInteger pRight) { 137 return pLeft.add(pRight); 138 } 139 140 } 142 | Popular Tags |