cleand up function signatures
This commit is contained in:
parent
08cbf4a7f5
commit
c6fdc4b093
@ -3,9 +3,9 @@ import java.util.ArrayList;
|
|||||||
public class OrderSystem {
|
public class OrderSystem {
|
||||||
private StorageManager systemManager;
|
private StorageManager systemManager;
|
||||||
private ArrayList<Client> systemClients;
|
private ArrayList<Client> systemClients;
|
||||||
public OrderSystem(StorageManager manager, ArrayList<Client> clients) {
|
public OrderSystem(StorageManager manager) {
|
||||||
this.systemManager = manager;
|
this.systemManager = manager;
|
||||||
this.systemClients = clients;
|
this.systemClients = new ArrayList<Client>();
|
||||||
}
|
}
|
||||||
public void addProduct(Product product) {
|
public void addProduct(Product product) {
|
||||||
this.systemManager.addProduct(product);
|
this.systemManager.addProduct(product);
|
||||||
@ -52,4 +52,4 @@ public class OrderSystem {
|
|||||||
System.out.println("ID: " + product.getID() + ", Name: " + product.getName() + ", Price: " + product.getPrice() + ", Amount: " + product.getAmount());
|
System.out.println("ID: " + product.getID() + ", Name: " + product.getName() + ", Price: " + product.getPrice() + ", Amount: " + product.getAmount());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,8 @@ import java.util.ArrayList;
|
|||||||
|
|
||||||
public class StorageManager {
|
public class StorageManager {
|
||||||
private ArrayList<Product> storageProducts;
|
private ArrayList<Product> storageProducts;
|
||||||
public StorageManager(ArrayList<Product> products) {
|
public StorageManager() {
|
||||||
this.storageProducts = products;
|
this.storageProducts = new ArrayList<Product>();
|
||||||
}
|
}
|
||||||
public void addProduct(Product product) {
|
public void addProduct(Product product) {
|
||||||
this.storageProducts.add(product);
|
this.storageProducts.add(product);
|
||||||
|
@ -6,8 +6,8 @@ public class TechStore {
|
|||||||
System.out.print(input);
|
System.out.print(input);
|
||||||
}
|
}
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
StorageManager manager = new StorageManager(new ArrayList<Product>());
|
StorageManager manager = new StorageManager();
|
||||||
OrderSystem system = new OrderSystem(manager, new ArrayList<Client>());
|
OrderSystem system = new OrderSystem(manager);
|
||||||
Scanner scnr = new Scanner(System.in);
|
Scanner scnr = new Scanner(System.in);
|
||||||
while (true) {
|
while (true) {
|
||||||
p("\nInput mode: ");
|
p("\nInput mode: ");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user