package com.mybank.domain;

import java.util.ArrayList;
import java.util.List;

public class Customer {

	private String firstName;
	private String lastName;
	private Account account;
	private int numOfAccounts;
	private List<Account> accounts;

	public Customer(String f, String l) {
		firstName = f;
		lastName = l;
		numOfAccounts = 0;
		accounts = new ArrayList<Account>();
	}

	public String getFirstName() {
		return firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public Account getAccount() {
		return account;
	}

	public void setAccount(Account acct) {
		account = acct;
	}

	public void addAccount(Account acct) {
		accounts.add(acct);
		numOfAccounts++;
	}

	public Account getAccount(int index) {
		if (index >= 0) {
			if (accounts.get(index) != null) {
				return accounts.get(index);
			}
		}
		return null;
	}

	public int getNumOfAccounts() {
		return numOfAccounts;
	}
}