Implement the comparable interface.

This commit is contained in:
Danila Fedorin 2017-09-16 00:18:43 -07:00
parent 0ff071e212
commit 14ac9c67f4
1 changed files with 1 additions and 9 deletions

View File

@ -5,7 +5,7 @@ import org.nwapw.abacus.exception.ComputationInterruptedException;
/**
* An interface used to represent a number.
*/
public abstract class NumberInterface {
public abstract class NumberInterface implements Comparable<NumberInterface> {
/**
* Check if the thread was interrupted and
@ -158,14 +158,6 @@ public abstract class NumberInterface {
return intPowInternal(exponent);
}
/**
* Compares this number to another.
*
* @param number the number to compare to.
* @return same as Integer.compare();
*/
public abstract int compareTo(NumberInterface number);
/**
* Same as Math.signum().
*