3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 package de.dhbwloe.campusapp.search;
18 import java.util.ArrayList;
19 import java.util.Date;
21 import de.dhbwloe.campusapp.CampusAppContext;
24 * Created by pk910 on 19.01.2016.
26 public class SearchIndices {
27 private String keyname = null;
28 private StringBuilder keywordsBuffer = new StringBuilder();
29 protected boolean isStatic = false;
30 protected String target = new String();
31 protected String keywords = null;
32 protected String title = null;
33 protected String description = null;
34 protected long updateTime = 0;
36 public SearchIndices(String keyname) {
37 this.keyname = keyname;
38 this.updateTime = (new Date()).getTime()/1000;
41 public SearchIndices(String keyname, boolean isStatic) {
42 this.keyname = keyname;
43 this.isStatic = isStatic;
46 public void addKeyWord(String words) {
47 if(keywordsBuffer.length() > 0)
48 keywordsBuffer.append('\n');
49 keywordsBuffer.append(words);
52 public void addKeyWord(int words) {
53 addKeyWord(CampusAppContext.getInstance().getResString(words));
56 public void setTarget(String target) {
60 public void setDescription(String description) {
61 this.description = description;
64 public void setTitle(String title) {
68 public void setDescription(int description) {
69 this.description = CampusAppContext.getInstance().getResString(description);
72 public void setTitle(int title) {
73 this.title = CampusAppContext.getInstance().getResString(title);
76 public void setUpdateTime(long updateTime) {
77 this.updateTime = updateTime;
80 public String getKeyName() {
84 public String getKeyWords() {
85 return (this.keywords != null ? this.keywords : "") + this.keywordsBuffer.toString();
88 public boolean getIsStatic() {
92 public String getTarget() {
96 public String getDescription() {
97 return this.description;
100 public String getTitle() {
104 public long getUpdateTime() {
105 return this.updateTime;