mirror of
https://github.com/DanilaFe/abacus
synced 2024-12-22 15:30:09 -08:00
Implement the comparable interface.
This commit is contained in:
parent
0ff071e212
commit
14ac9c67f4
|
@ -5,7 +5,7 @@ import org.nwapw.abacus.exception.ComputationInterruptedException;
|
||||||
/**
|
/**
|
||||||
* An interface used to represent a number.
|
* 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
|
* Check if the thread was interrupted and
|
||||||
|
@ -158,14 +158,6 @@ public abstract class NumberInterface {
|
||||||
return intPowInternal(exponent);
|
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().
|
* Same as Math.signum().
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user