package expression.generic;

/**
 * @author Doschennikov Nikita (me@fymio.us)
 */
public interface ArithmeticType<T> {
    T fromInt(int value);
    T add(T a, T b);
    T subtract(T a, T b);
    T multiply(T a, T b);
    T divide(T a, T b);
    T negate(T a);

    default T count(T a) {
        throw new UnsupportedOperationException("count");
    }

    default T min(T a, T b) {
        throw new UnsupportedOperationException("min");
    }

    default T max(T a, T b) {
        throw new UnsupportedOperationException("max");
    }
}
