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