-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgramMainStock.java
More file actions
41 lines (33 loc) · 1.16 KB
/
ProgramMainStock.java
File metadata and controls
41 lines (33 loc) · 1.16 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
36
37
38
39
40
41
import java.io.InputStreamReader;
import controller.IStockController;
import controller.gui.StockControllerGUI;
import controller.text.StockController;
import model.IModel;
import model.Model;
import view.gui.IViewGUI;
import view.gui.TextViewGUI;
/**
* The ProgramMainStock class serves as the entry point for the stock management application.
* It initializes the necessary components and starts the application by invoking the controller.
*/
public class ProgramMainStock {
/**
* The main method initializes the application by creating a Readable and Appendable
* for input and output, respectively, and starts the StockController.
*
* @param args Command-line arguments (not used).
*/
public static void main(String[] args) {
if (args.length == 1) {
Readable rd = new InputStreamReader(System.in);
Appendable ap = System.out;
IStockController stockController2 = new StockController(rd, ap);
stockController2.goController();
} else {
IModel m = new Model();
IViewGUI v = new TextViewGUI();
IStockController stockController = new StockControllerGUI(m, v);
stockController.goController();
}
}
}