Aktienhandel #4
@ -1,27 +1,25 @@
|
|||||||
package tech_store;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
public class StorageManager {
|
||||||
|
private ArrayList<Product> storageProducts;
|
||||||
public class StorageManager {
|
public StorageManager(ArrayList<Product> products) {
|
||||||
private ArrayList<Product> storageProducts;
|
this.storageProducts = products;
|
||||||
public StorageManager(ArrayList<Product> products) {
|
}
|
||||||
this.storageProducts = products;
|
public void addProduct(Product product) {
|
||||||
}
|
this.storageProducts.add(product);
|
||||||
public void addProduct(Product product) {
|
}
|
||||||
this.storageProducts.add(product);
|
public ArrayList<Product> getStorage() {
|
||||||
}
|
return this.storageProducts;
|
||||||
public ArrayList<Product> getStorage() {
|
}
|
||||||
return this.storageProducts;
|
public void increaseStorage(int id, int amt) {
|
||||||
}
|
this.getProductByID(id).increaseAmount(amt);
|
||||||
public void increaseStorage(int id, int amt) {
|
}
|
||||||
this.getProductByID(id).increaseAmount(amt);
|
public Product getProductByID(int id) {
|
||||||
}
|
for (Product product : this.storageProducts) {
|
||||||
public Product getProductByID(int id) {
|
if (product.getID() == id) {
|
||||||
for (Product product : this.storageProducts) {
|
return product;
|
||||||
if (product.getID() == id) {
|
}
|
||||||
return product;
|
}
|
||||||
}
|
return new Product(-1, "", 0, 0);
|
||||||
}
|
}
|
||||||
return new Product(-1, "", 0, 0);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user