public class CentralHost
extends java.lang.Object
Constructor and Description |
---|
CentralHost() |
Modifier and Type | Method and Description |
---|---|
boolean |
accountExists(int accountNumber) |
void |
createAccount(int accountNumber)
Create a new account with account number
accountNumber |
PermanentAccount |
getAccount(int accountNumber)
Obtain the account with number
accountNumber |
BankCard |
issueCard(int accountNumber,
int pin)
Issue a bank card for the account with number
accountNumber
and setup the card with the given PIN |
static void |
main(java.lang.String[] args)
An example scenario
|
java.lang.String |
toString() |
public PermanentAccount getAccount(int accountNumber)
accountNumber
accountNumber
- the number of the account that is requestedaccountNumber
, or
null
iff no such account existspublic boolean accountExists(int accountNumber)
true
iff there is an account with number
accountNumber
public void createAccount(int accountNumber)
accountNumber
accountNumber
- the number of the account to be createdpublic BankCard issueCard(int accountNumber, int pin)
accountNumber
and setup the card with the given PINaccountNumber
- number of the account for which a card is supposed to be
issuedpin
- the PIN of the card to be issuedpublic static void main(java.lang.String[] args)
public java.lang.String toString()
toString
in class java.lang.Object