padre-master/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/dom/TimesOperatorExpression.java
package org.eclipse.epsilon.eol.dom;

import org.eclipse.epsilon.eol.exceptions.EolRuntimeException;
import org.eclipse.epsilon.eol.execute.context.IEolContext;
import org.eclipse.epsilon.eol.types.NumberUtil;

public class TimesOperatorExpression extends EagerOperatorExpression {
	
	public TimesOperatorExpression() {}
	
	public TimesOperatorExpression(Expression firstOperand, Expression secondOperand) {
		super(firstOperand, secondOperand);
	}
	
	@Override
	public Object execute(Object o1, Object o2, IEolContext context) throws EolRuntimeException {
		if (o1 instanceof Number && o2 instanceof Number){
			return NumberUtil.multiply((Number) o1, (Number) o2);
		}
		return new Integer(0);
	}
	
}
