1 12 package org.openbravo.xmlEngine; 13 14 import org.apache.log4j.Logger ; 15 16 class FunctionMultiplyValue extends FunctionEvaluationValue { 17 18 static Logger log4jFunctionMultiplyValue = Logger.getLogger(FunctionMultiplyValue.class); 19 20 public FunctionMultiplyValue(FunctionTemplate functionTemplate, XmlDocument xmlDocument) { 21 super(functionTemplate, xmlDocument); 22 } 23 24 public String print() { 25 log4jFunctionMultiplyValue.debug("Arg1: " + arg1Value.printSimple() + " Arg2: " + arg2Value.printSimple()); 26 if (arg1Value.print().equals(XmlEngine.strTextDividedByZero) || arg2Value.print().equals(XmlEngine.strTextDividedByZero)) { 27 return XmlEngine.strTextDividedByZero; 28 } else { 29 return functionTemplate.printFormatOutput(Double.valueOf(arg1Value.printSimple()).doubleValue() * Double.valueOf(arg2Value.printSimple()).doubleValue()); 30 } 31 } 32 33 public String printSimple() { 34 log4jFunctionMultiplyValue.debug("Arg1: " + arg1Value.printSimple() + " Arg2: " + arg2Value.printSimple()); 35 if (arg1Value.print().equals(XmlEngine.strTextDividedByZero) || arg2Value.print().equals(XmlEngine.strTextDividedByZero)) { 36 return XmlEngine.strTextDividedByZero; 37 } else { 38 return functionTemplate.printFormatSimple(Double.valueOf(arg1Value.printSimple()).doubleValue() * Double.valueOf(arg2Value.printSimple()).doubleValue()); 39 } 40 } 41 42 } 43 | Popular Tags |