forked from HVFrancis/BJF18-networkv15
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MessagePost.java
36 lines (33 loc) · 899 Bytes
/
MessagePost.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import java.util.ArrayList;
/**
* This class stores information about a post in a social network news feed.
* The main part of the post consists of a (possibly multi-line)
* text message. Other data, such as author and time, are also stored.
*
* @author Michael Kölling and David J. Barnes
* @version 0.2
*/
public class MessagePost extends Post
{
private String message; // an arbitrarily long, multi-line message
/**
* Constructor for objects of class MessagePost.
*
* @param author The username of the author of this post.
* @param text The text of this post.
*/
public MessagePost(String author, String text)
{
super(author);
message = text;
}
/**
* Return the text of this post.
*
* @return The post's message text.
*/
public String getText()
{
return message;
}
}