-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnopNode.java
More file actions
34 lines (27 loc) · 797 Bytes
/
Copy pathUnopNode.java
File metadata and controls
34 lines (27 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package GP;
public class UnopNode extends OperatorNode {
private Node child = null;
public UnopNode(Node child) {
this.child = child;
}
public Node getChild() {
return child;
}
public void setChild(Node child) {
this.child = child;
if (child instanceof TerminalNode) {
((TerminalNode) child).parent = this;
}
if (child instanceof OperatorNode) {
((OperatorNode) child).parent = this;
}
}
@Override
public double evaluate(double[] input) {
throw new UnsupportedOperationException("UnopNode.evaluate() not implemented");
}
@Override
public String toString() {
throw new UnsupportedOperationException("UnopNode.toString() not implemented");
}
}