mirror of
https://github.com/DanilaFe/abacus
synced 2024-11-18 08:29:33 -08:00
26 lines
476 B
Java
26 lines
476 B
Java
|
package org.nwapw.abacus.tree;
|
||
|
|
||
|
import org.nwapw.abacus.number.NaiveNumber;
|
||
|
import org.nwapw.abacus.number.Number;
|
||
|
|
||
|
public class NumberNode extends TreeNode {
|
||
|
|
||
|
private Number number;
|
||
|
|
||
|
public NumberNode(){
|
||
|
number = null;
|
||
|
}
|
||
|
|
||
|
public NumberNode(double value){
|
||
|
number = new NaiveNumber(value);
|
||
|
}
|
||
|
|
||
|
public NumberNode(String value){
|
||
|
this(Double.parseDouble(value));
|
||
|
}
|
||
|
|
||
|
public Number getNumber() {
|
||
|
return number;
|
||
|
}
|
||
|
}
|