1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-12-22 07:20:09 -08:00

Have the NumberInterface provide the Kotlin rangeTo method.

This commit is contained in:
Danila Fedorin 2017-09-20 13:22:18 -07:00
parent 4c94abb18b
commit e364f4e94b

View File

@ -238,4 +238,16 @@ public abstract class NumberInterface implements Comparable<NumberInterface> {
*/ */
public abstract NumberInterface getMaxError(); public abstract NumberInterface getMaxError();
/**
* Returns a NumberRangeBuilder object, which is used to create a range.
* The reason that this returns a builder and not an actual range is that
* the NumberRange needs to promote values passed to it, which
* requires an abacus instance.
* @param other the value at the bottom of the range.
* @return the resulting range builder.
*/
public NumberRangeBuilder rangeTo(NumberInterface other){
return new NumberRangeBuilder(this, other);
}
} }