package com.hammurapi.extract;

import java.util.concurrent.TimeUnit;


public class Multiply<T, C> extends ArithmeticExtractor<T, Number, C> {

	public Multiply(double initialCost, TimeUnit costUnit, Extractor<T, Number, C> leftExtractor, Extractor<T, Number, C> rightExtractor) {
		super(initialCost, costUnit, leftExtractor, rightExtractor, true);
	}

	@Override
	protected Object doOp(int n1, int n2) {
		return n1*n2;
	}

	@Override
	protected Object doOp(long n1, long n2) {
		return n1*n2;
	}

	@Override
	protected Object doOp(float n1, float n2) {
		return n1*n2;
	}

	@Override
	protected Object doOp(double n1, double n2) {
		return n1*n2;
	}
	
	@Override
	protected Extractor<T, Number, C> newInstance(Extractor<T, Number, C> leftExtractor, Extractor<T, Number, C> rightExtractor) {
		return new Multiply<T,C>(initialCost, costUnit, leftExtractor, rightExtractor);
	}
}
