mirror of
https://github.com/DanilaFe/abacus
synced 2026-01-27 17:15:21 +00:00
Add promotion implementation.
This commit is contained in:
@@ -48,5 +48,10 @@ public class NaiveNumber implements Number {
|
||||
return new NaiveNumber(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Number promoteTo(Class<? extends Number> toClass) {
|
||||
if(toClass == this.getClass()) return this;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user