Created
January 7, 2016 12:43
-
-
Save juthawong/392a2bdc3c3ad2b244b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example; | |
import java.util.Date; | |
public class BlogPost { | |
private String mAuthor; | |
private String mTitle; | |
private String mBody; | |
private String mCategory; | |
private Date mCreationDate; | |
public BlogPost(String author, String title, String body, String category, Date creationDate) { | |
mAuthor = author; | |
mTitle = title; | |
mBody = body; | |
mCategory = category; | |
mCreationDate = creationDate; | |
} | |
public String getAuthor() { | |
return mAuthor; | |
} | |
public String getTitle() { | |
return mTitle; | |
} | |
public String getBody() { | |
return mBody; | |
} | |
public String getCategory() { | |
return mCategory; | |
} | |
public Date getCreationDate() { | |
return mCreationDate; | |
} | |
public String[] getWords(){ | |
return mBody.split("\\s+"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment