public class Mailbox extends java.lang.Object
Constructor and Description |
---|
Mailbox(java.lang.String aPasscode,
java.lang.String aGreeting)
Create Mailbox object.
|
Modifier and Type | Method and Description |
---|---|
void |
addMessage(Message aMessage)
Add a message to the mailbox.
|
boolean |
checkPasscode(java.lang.String aPasscode)
Check if the entered supplied is correct.
|
Message |
removeCurrentMessage()
Remove the current message from the mailbox.
|
void |
saveCurrentMessage()
Save the current message
|
void |
setGreeting(java.lang.String newGreeting)
Change mailbox's greeting.
|
void |
setPasscode(java.lang.String newPasscode)
Change mailbox's passcode.
|
public Mailbox(java.lang.String aPasscode, java.lang.String aGreeting)
aPasscode
- passcode numberaGreeting
- greeting stringpublic boolean checkPasscode(java.lang.String aPasscode)
aPasscode
- a passcode to checkpublic void addMessage(Message aMessage)
aMessage
- the message to be addedpublic Message removeCurrentMessage()
public void saveCurrentMessage()
public void setGreeting(java.lang.String newGreeting)
newGreeting
- the new greeting stringpublic void setPasscode(java.lang.String newPasscode)
newPasscode
- the new passcode