All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.softicar.platform.common.math.arithmetic.LongArithmetic Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
package com.softicar.platform.common.math.arithmetic;

/**
 * Implementation of {@link IArithmetic} for {@link Long}.
 *
 * @author Oliver Richers
 */
class LongArithmetic implements IArithmetic {

	private static final Long ZERO = 0L;
	private static final Long ONE = 1L;

	@Override
	public Long getZero() {

		return ZERO;
	}

	@Override
	public Long getOne() {

		return ONE;
	}

	@Override
	public Long plus(Long left, Long right) {

		return left + right;
	}

	@Override
	public Long minus(Long left, Long right) {

		return left - right;
	}

	@Override
	public Long times(Long left, Long right) {

		return left * right;
	}

	@Override
	public Long divided(Long left, Long right) {

		return left / right;
	}

	@Override
	public Long negate(Long value) {

		return -value;
	}

	@Override
	public int compare(Long left, Long right) {

		return Long.compare(left, right);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy