java.lang.ObjectMailClient
public class MailClient
A class to model a simple email client. The client is run by a particular user, and sends and retrieves mail via a particular server.
Constructor Summary | |
---|---|
MailClient(MailServer server,
java.lang.String user)
Create a mail client run by user and attached to the given server. |
Method Summary | |
---|---|
MailItem |
getNextMailItem()
Return the next mail item (if any) for this user. |
void |
printNextMailItem()
Print the next mail item (if any) for this user to the text terminal. |
void |
sendMessage(java.lang.String to,
java.lang.String message)
Send the given message to the given recipient via the attached mail server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MailClient(MailServer server, java.lang.String user)
Method Detail |
---|
public MailItem getNextMailItem()
public void printNextMailItem()
public void sendMessage(java.lang.String to, java.lang.String message)
to
- The intended recipient.mess
- A fully prepared message to be sent.