nvariable.java
来自「是zuojie用java实现的gep库」· Java 代码 · 共 60 行
JAVA
60 行
package gep.num;import gep.Expression;import java.util.ArrayList;import java.util.List;/** * 变量 */public class NVariable implements NExpression{ public static final int arity = 0; private char code; private double value; public NVariable(char code) { this.code = code; } public char getCode() { return code; } public int getArity() { return arity; } public void addChild(Expression child) { throw new IllegalStateException("ADD_CHILD_ERROR"); } public void setValue(double value) { this.value = value; } public double evaluate() { return value; } public String toString() { return "" + code; } public List getChildren() { List children = new ArrayList(); return children; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?