1 25 26 29 package net.killingar.forum.internal; 30 31 import java.util.Date ; 32 33 public class FAQ extends IDItemImpl implements OwnerIDItem 34 { 35 public long ownerID = -1, topicID = -1; 36 public String question, answer; 37 public int priority; 38 public Date date; 39 40 public FAQ(long _ID, long _ownerID, long _topicID, String _question, String _answer, Date _date, int _priority) 41 { 42 super(_ID); 43 ownerID = _ownerID; 44 topicID = _topicID; 45 question = _question; 46 answer = _answer; 47 priority = _priority; 48 date = _date; 49 } 50 51 public FAQ(long _topicID, String _question, String _answer, int _priority) 52 { 53 super(-1); 54 topicID = _topicID; 55 question = _question; 56 answer = _answer; 57 priority = _priority; 58 } 59 60 61 public int compareTo(Object o) 62 { 63 FAQ faq = (FAQ)o; 64 if (faq.priority == priority) 65 return question.compareToIgnoreCase(faq.question); 66 else if (faq.priority < priority) 67 return -1; 68 else 69 return 1; 70 } 71 72 73 public long getOwnerID() { return ownerID; } 74 public long getTopicID() { return topicID; } 75 public String getQuestion() { return question; } 76 public String getAnswer() { return answer; } 77 public int getPriority() { return priority; } 78 public Date getDate() { return date; } 79 } | Popular Tags |