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
1 changed files with 12 additions and 0 deletions

View File

@ -238,4 +238,16 @@ public abstract class NumberInterface implements Comparable<NumberInterface> {
*/
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);
}
}