response.java

来自「JAVA Servlet2.3外文书籍源码」· Java 代码 · 共 63 行

JAVA
63
字号
package forum;

/**
 * Represents a response to a topic.
 *
 * @author    Simon Brown
 */
public class Response extends Posting {

  /** the Topic to which this response is associated */
  private Topic topic;

  /** a flag indicating whether this repsonse has been deleted */
  private boolean deleted = false;

  /**
   * Creates a new response with the specified information.
   *
   * @param user    the User that posted the response
   * @param text    the text of the response
   */
  public Response(User user, String text) {
    super(user, text);
  }

  /**
   * Determines whether this response has been deleted from the topic.
   *
   * @return  true if it has been deleted,
   *          false otherwise (if it is still visible)
   */
  public boolean isDeleted() {
    return this.deleted;
  }

  /**
   * Sets whether this response has been deleted from the topic.
   *
   * @param b   true if this response is to be deleted, false otherwise
   */
  public void setDeleted(boolean b) {
    this.deleted = b;
  }

  /**
   * Setter for the topic property.
   *
   * @param topic   the Topic instance
   */
  public void setTopic(Topic topic) {
    this.topic = topic;
  }

  /**
   * Getter for the topic property.
   *
   * @return  the Topic instance
   */
  public Topic getTopic() {
    return this.topic;
  }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?