PostJavadoc

code format="java" package faceplace;

/** *Represents a post or comment on a user's wall, contains the text, time, *and author, as well as a list of users who have liked it. */

import java.util.Date; import java.lang.Long;

public class Post implements Comparable {

private String text; private User author; private Date date; private ArrayList likedBy;

/** *Creates a new post, assigning values to text and author provided to it, *and assigning the current date (and time) to the date. *@param text a string containing the text for the Post. *@param author a User object who is the author of the Post. */ <- I think we don't need this, because Post is at package level (and not public) Post(String text, User author) {

}

/** public User getAuthor { return author; }
 * Returns the User who is the author of the Post.
 * @returns the creator of the Post.

/** public String getText { return text; }
 * Returns the String containing the text of the Post.
 * @returns the text of the Post.

/** public Date getDate { return date; }
 * Returns the Date that specifies the date and time
 * a Post was made.
 * @returns the Date the Post was created.

/** public ArrayList getLikedBy { return likedBy; }
 * Returns the ArrayList of Users that have previous
 * 'liked' this post. These Users clicked a 'like'
 * button that is attached to the post on the
 * faceplace site.
 * returns the ArraList of Users that like the post.

/** public void like(User user) {
 * Adds the given User to the likedBy ArrayList.
 * @params user a User who has 'liked' the Post.

}

/** public int compareTo(Post other) {
 * Compares two Post objects by date (and time).
 * It compares the Post that the method was
 * called on with a given Post. It then returns
 * an int representation of which came first.
 * (It allows you to use the sort method of the
 * collections class)
 * @params other the post object to compare against
 * @returns an int that shows whether the
 * parameter Post came before or after.

}

/** public String toString {
 * Returns a String that contains all of the
 * information of the Post so that it can
 * be stored in a file to allow persistence.
 * @returns a String containing the name of the
 * User that created the post, the text of the
 * Post, the Date (in long format) when the
 * Post was created, and the name of each User
 * in the likedBy ArrayList.

}

/** public void setTime(time long) {
 * Sets the Date of the Post to a given long.
 * @params time a long format of a date and time.

} } code