Class TextMessage
java.lang.Object
|
+--Message
|
+--TextMessage
- All Implemented Interfaces:
- Cloneable
- public class TextMessage
- extends Message
Message with a textual body; nice for demonstrating host->host
transmission (though plain Messages work fine too).
- Version:
- 2002-04-10
- Author:
- Max Hailperin
Constructor Summary |
TextMessage(int source,
int destination,
String body)
Constructor for objects of class TextMessage |
Method Summary |
String |
getBody()
returns the string the TextMessage is carrying |
String |
toString()
returns a String describing the TextMessage |
TextMessage
public TextMessage(int source,
int destination,
String body)
- Constructor for objects of class TextMessage
- Parameters:
source
- address of source Portdestination
- address of destination Port(s)body
- String being sent
getBody
public String getBody()
- returns the string the TextMessage is carrying
- Returns:
- the TextMessage's body
toString
public String toString()
- returns a String describing the TextMessage
- Overrides:
toString
in class Message
- Returns:
- a description of the TextMessage
Generated by BlueJ