1 13 15 package org.jahia.data.search; 16 17 import java.util.ArrayList ; 18 19 import org.jahia.services.pages.JahiaPage; 20 import org.jahia.services.search.ParsedObject; 21 22 31 public class JahiaSearchHit implements JahiaSearchHitInterface 32 { 33 34 public int id; 35 public int type; public Object obj; 37 38 public int wordcount; 39 40 public String fileDownloadUrl = "#"; 41 public String pageUrl = "#"; 42 public ArrayList languageCodes = new ArrayList (); 43 44 48 public String teaser; 49 50 public int pageID; 51 52 53 public JahiaPage page; 54 55 private ParsedObject parsedObject; 56 57 61 public JahiaSearchHit(ParsedObject aParsedObject){ 62 this.parsedObject = aParsedObject; 63 } 64 65 69 public ArrayList getLanguageCodes(){ 70 return this.languageCodes; 71 } 72 73 77 public void setLanguageCodes(ArrayList languagesCode){ 78 this.languageCodes = languagesCode; 79 } 80 81 84 public int getScore(){ 85 return this.wordcount; 86 } 87 88 92 public void setScore(int score){ 93 this.wordcount = score; 94 } 95 96 99 public String getTeaser(){ 100 return this.teaser; 101 } 102 103 106 public void setTeaser(String aTeaser){ 107 this.teaser = aTeaser; 108 } 109 110 114 public ParsedObject getParsedObject(){ 115 return this.parsedObject; 116 } 117 118 121 public void setParsedObject(ParsedObject aParsedObject){ 122 this.parsedObject = aParsedObject; 123 } 124 125 131 public int compareTo(Object anObj) throws ClassCastException { 132 133 JahiaSearchHitInterface hit = (JahiaSearchHitInterface)anObj; 134 if ( hit.getScore() > this.wordcount ){ 135 return 1; 136 } else if ( hit.getScore() == this.wordcount ){ 137 return 0; 138 } 139 return -1; 140 } 141 142 } 143 | Popular Tags |