-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddition.java
More file actions
30 lines (26 loc) · 744 Bytes
/
Addition.java
File metadata and controls
30 lines (26 loc) · 744 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
/**
* An Integer Addition.
*
* @author Mak Fazlic & Roberto Ferrari - Latex project.
* @version v1.0
*/
public class Addition extends Node {
// instance variables
private final Node leftChild;
private final Node rightChild;
/**
* Constructor for objects of class Division.
* @param leftChild expression Node.
* @param rightChild expression Node.
*/
public Addition(final Node leftChild, final Node rightChild) {
super();
this.leftChild = leftChild;
this.rightChild = rightChild;
}
@Override
// Returns Latex of Addition
public String toLatex() {
return "{\\left(" + leftChild.toLatex() + "+" + rightChild.toLatex() + "\\right)}";
}
}