    001package com.hammurapi.extract;
    002
    003import java.util.concurrent.TimeUnit;
    004
    005
    006public class Subtract<T, C> extends ArithmeticExtractor<T, Number, C> {
    007
    008        public Subtract(double initialCost, TimeUnit costUnit, Extractor<T, Number, C> leftExtractor, Extractor<T, Number, C> rightExtractor) {
    009                super(initialCost, costUnit, leftExtractor, rightExtractor, true);
    010        }
    011
    012        @Override
    013        protected Object doOp(int n1, int n2) {
    014                return n1-n2;
    015        }
    016
    017        @Override
    018        protected Object doOp(long n1, long n2) {
    019                return n1-n2;
    020        }
    021
    022        @Override
    023        protected Object doOp(float n1, float n2) {
    024                return n1-n2;
    025        }
    026
    027        @Override
    028        protected Object doOp(double n1, double n2) {
    029                return n1-n2;
    030        }
    031
    032        @Override
    033        protected Extractor<T, Number, C> newInstance(Extractor<T, Number, C> leftExtractor, Extractor<T, Number, C> rightExtractor) {
    034                return new Subtract<T,C>(initialCost, costUnit, leftExtractor, rightExtractor);
    035        }
    036}