📄 client.java
字号:
import java.util.*;
/**
* This class models a bank client. The following information is
* maintained:
* <ol>
* <li>The name of the client, a <code>String</code></li>
* <li>The bank accounts of the client, a <code>Vector</code></li>
* </ol>
*
* @author author name
* @version 1.0.0
*/
public class Client {
/* Name of client */
private String name;
/* Collection of <code>BankAccounts</code> objects.*/
private Vector accounts;
/**
* Constructs a <code>Client</code> object.
* <p>
* Creates an empty collection of bank accounts.
* </p>
*
* @param initialName the name of the client.
*/
public Client(String initialName) {
name = initialName;
accounts = new Vector();
}
/**
* Adds a bank account to this client.
*
* @param bankAccount the {@link BankAccount} object.
*/
public void addAccount(BankAccount bankAccount) {
accounts.add(bankAccount);
}
/**
* Returns an iterator over the bank accounts of this client.
*
* return an {@link Iterator} over the bank accounts of this
* client.
*/
public Iterator getAccountsIterator() {
return accounts.iterator();
}
/**
* Returns the number of bank account of this client.
*
* @return the number of bank account of this client.
*/
public int getNumberOfAccounts() {
return accounts.size();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -