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

com.cogpunk.math.IntegerOperator Maven / Gradle / Ivy

There is a newer version: 1.0.4
Show newest version
package com.cogpunk.math;

public class IntegerOperator implements NumberOperator {
	
	@Override
	public Integer add(Integer first, Integer second) {
		return first + second;
	}
	
	@Override
	public Integer subtract(Integer first, Integer second) {
		return first - second;
	}
	
	@Override
	public Integer multiply(Integer first, Integer second) {
		return first * second;
	}
	
	@Override
	public Integer divide(Integer first, Integer second) {
		return first / second;
	}

	@Override
	public Integer cast(Number i) {
		return i.intValue();
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public boolean equals(final Object other) {
		return (other instanceof IntegerOperator);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public int hashCode() {
		return getClass().hashCode();
	}

	
	
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy