-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathMain.java
More file actions
35 lines (28 loc) · 1.15 KB
/
Main.java
File metadata and controls
35 lines (28 loc) · 1.15 KB
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
35
package calcproject;
import java.util.HashMap;
import java.util.Map;
import calcproject.engine.CalcExpressionTokenizer;
import calcproject.engine.Calculator;
import calcproject.models.CalcResultRecordModel;
import calcproject.repository.CalcResultRecordRepository;
import calcproject.repository.MemoryCalcResultRecordRepository;
import calcproject.service.CalcManager;
import calcproject.view.CalcInput;
import calcproject.view.CalcOutput;
import calcproject.view.console.CalcConsoleView;
public class Main {
public static void main(String[] args) {
CalcExpressionTokenizer calcExpressionTokenizer = new CalcExpressionTokenizer();
Calculator calculator = new Calculator(calcExpressionTokenizer);
Map<Integer, CalcResultRecordModel> calcMap = new HashMap<>();
CalcResultRecordRepository calcResultRecordRepository =
new MemoryCalcResultRecordRepository(calcMap);
CalcConsoleView calcConsoleView = new CalcConsoleView();
CalcInput calcInput = calcConsoleView;
CalcOutput calcOutput = calcConsoleView;
CalcManager calcManager = new CalcManager(
calcResultRecordRepository, calcInput, calcOutput, calculator
);
calcManager.startCalcManager();
}
}