public class Tweet
extends java.lang.Object
| Constructor and Description |
|---|
Tweet(java.lang.String text,
java.lang.String userName,
java.lang.String date)
Constructs a Tweet object.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getDate()
Get the date of the post in YYYY-MM-DD format.
|
java.lang.String |
getText()
Get the message text of the Tweet.
|
java.lang.String |
getUserName()
Get the user name of the poster.
|
static Tweet |
read(java.util.Scanner sc)
Reads data from a Scanner and creates & returns a Tweet from it.
|
java.lang.String |
toString()
Returns a String representation of a Tweet in message-tab-user-tab-date format.
|
public Tweet(java.lang.String text,
java.lang.String userName,
java.lang.String date)
text - The text of the messageuserName - the Twitter user name of the posterdate - the date in YYYY-MM-DD format, e.g. "2014-12-25"public static Tweet read(java.util.Scanner sc)
IC211 was awesome today ... as usual. csitmid 2015-02-13
sc - The scanner that input will be read from.public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getText()
public java.lang.String getUserName()
public java.lang.String getDate()