1 43 package net.jforum.dao; 44 45 import java.util.Date ; 46 47 51 public class SearchData 52 { 53 private String keywords = ""; 54 private String author; 55 private String orderBy = "ASC"; 56 private String orderByField; 57 58 private boolean useAllWords; 59 private boolean searchStarted; 60 61 private int forumId; 62 private int categoryId; 63 64 private Date time; 65 66 public void setKeywords(String keywords) 67 { 68 this.keywords = keywords; 69 } 70 71 public void setUseAllWords(boolean b) 72 { 73 this.useAllWords = b; 74 } 75 76 public void setAuthor(String author) 77 { 78 this.author = author; 79 } 80 81 public void setForumId(int forumId) 82 { 83 this.forumId = forumId; 84 } 85 86 public void setOrderByField(String f) 87 { 88 this.orderByField = f; 89 } 90 91 public void setSearchStarted(boolean started) 92 { 93 this.searchStarted = started; 94 } 95 96 public void setCategoryId(int categoryId) 97 { 98 this.categoryId = categoryId; 99 } 100 101 public void setOrderBy(String orderBy) 102 { 103 this.orderBy = (orderBy == null ? "ASC" : orderBy); 104 } 105 106 public void setTime(Date time) 107 { 108 this.time = time; 109 } 110 111 public String [] getKeywords() 112 { 113 if (this.keywords == null) { 114 return new String [] {}; 115 } 116 117 return this.keywords.split(" "); 118 } 119 120 public boolean getUseAllWords() 121 { 122 return this.useAllWords; 123 } 124 125 public String getAuthor() 126 { 127 return this.author; 128 } 129 130 public int getForumId() 131 { 132 return this.forumId; 133 } 134 135 public int getCategoryId() 136 { 137 return this.categoryId; 138 } 139 140 public String getOrderBy() 141 { 142 if (!"ASC".equals(this.orderBy) && !"DESC".equals(this.orderBy)) { 143 return "ASC"; 144 } 145 146 return this.orderBy; 147 } 148 149 public String getOrderByField() 150 { 151 return this.orderByField; 152 } 153 154 public Date getTime() 155 { 156 return this.time; 157 } 158 159 public boolean getSearchStarted() 160 { 161 return this.searchStarted; 162 } 163 } 164 | Popular Tags |