Class MailItem

java.lang.Object
  extended by MailItem

public class MailItem
extends java.lang.Object

A class to model a simple mail item. The item has sender and recipient addresses and a message string.

Version:
2005.07.06
Author:
David J. Barnes and Michael Kolling

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

MailItem

public 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.

Parameters:
from - The sender of this item.
to - The intended recipient of this item.
message - The text of the message to be sent.
Method Detail

getFrom

public java.lang.String getFrom()
Returns:
The sender of this message.

getMessage

public java.lang.String getMessage()
Returns:
The text of the message.

getTo

public java.lang.String getTo()
Returns:
The intended recipient of this message.

print

public void print()
Print this mail message to the text terminal.