1 package org.nextime.ion.backoffice.messageBoard; 2 3 import java.io.Serializable ; 4 import java.util.Date ; 5 6 9 public class Message implements Serializable , Comparable { 10 11 private String poster; 12 private Date date; 13 private String message; 14 15 19 public Date getDate() { 20 return date; 21 } 22 23 27 public String getMessage() { 28 return message; 29 } 30 31 35 public String getPoster() { 36 return poster; 37 } 38 39 43 public void setDate(Date date) { 44 this.date = date; 45 } 46 47 51 public void setMessage(String message) { 52 this.message = message; 53 } 54 55 59 public void setPoster(String poster) { 60 this.poster = poster; 61 } 62 63 66 public int compareTo(Object o) { 67 try { 68 Message m = (Message) o; 69 if (m.getDate().before(getDate())) { 70 return -1; 71 } else { 72 return 1; 73 } 74 } catch (Exception e) { 75 return -1; 76 } 77 } 78 79 } 80 | Popular Tags |