Newer
Older
POS_for_GUI / src / resources / CustomersModel.java
fujii kouta on 25 Apr 2022 527 bytes バグの修正とリファクタリング.
package resources;

import java.util.ArrayList;

public class CustomersModel {
	private ArrayList<Customer> customers;

	public CustomersModel() {
		customers = new ArrayList<>();
	}

	public Customer getCustomerById(int customerId) {
		return customers.get(customerId);
	}

	public void addCustomer(Customer customer) {
		customers.add(customer);
	}

	public void removeCustomer(int customerId) {
		customers.remove(customerId);
	}

	public int getCustomersCount() {
		return customers.size();
	}
}