1 package de.dhbwloe.campusapp.search;
3 import java.util.ArrayList;
6 import de.dhbwloe.campusapp.CampusAppContext;
9 * Created by pk910 on 19.01.2016.
11 public class SearchIndices {
12 private String keyname = null;
13 private StringBuilder keywordsBuffer = new StringBuilder();
14 protected boolean isStatic = false;
15 protected String target = new String();
16 protected String keywords = null;
17 protected String title = null;
18 protected String description = null;
19 protected long updateTime = 0;
21 public SearchIndices(String keyname) {
22 this.keyname = keyname;
23 this.updateTime = (new Date()).getTime()/1000;
26 public SearchIndices(String keyname, boolean isStatic) {
27 this.keyname = keyname;
28 this.isStatic = isStatic;
31 public void addKeyWord(String words) {
32 if(keywordsBuffer.length() > 0)
33 keywordsBuffer.append('\n');
34 keywordsBuffer.append(words);
37 public void addKeyWord(int words) {
38 addKeyWord(CampusAppContext.getInstance().getResString(words));
41 public void setTarget(String target) {
45 public void setDescription(String description) {
46 this.description = description;
49 public void setTitle(String title) {
53 public void setDescription(int description) {
54 this.description = CampusAppContext.getInstance().getResString(description);
57 public void setTitle(int title) {
58 this.title = CampusAppContext.getInstance().getResString(title);
61 public void setUpdateTime(long updateTime) {
62 this.updateTime = updateTime;
65 public String getKeyName() {
69 public String getKeyWords() {
70 return (this.keywords != null ? this.keywords : "") + this.keywordsBuffer.toString();
73 public boolean getIsStatic() {
77 public String getTarget() {
81 public String getDescription() {
82 return this.description;
85 public String getTitle() {
89 public long getUpdateTime() {
90 return this.updateTime;