java.lang.ObjectMailItem
public class MailItem
A class to model a simple mail item. The item has sender and recipient addresses and a message string.
Constructor Summary | |
---|---|
MailItem(java.lang.String from,
java.lang.String to,
java.lang.String message)
Create a mail item from sender to the given recipient, containing the given message. |
Method Summary | |
---|---|
java.lang.String |
getFrom()
|
java.lang.String |
getMessage()
|
java.lang.String |
getTo()
|
void |
print()
Print this mail message to the text terminal. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MailItem(java.lang.String from, java.lang.String to, java.lang.String message)
from
- The sender of this item.to
- The intended recipient of this item.message
- The text of the message to be sent.Method Detail |
---|
public java.lang.String getFrom()
public java.lang.String getMessage()
public java.lang.String getTo()
public void print()