Your browser does not support JavaScript and this site utilizes JavaScript to build content and provide links to additional information. You should either enable JavaScript in your browser settings or use a browser that supports JavaScript in order to take full advantage of this site.
1 32 33 package websphinx.searchengine; 34 35 import websphinx.*; 36 37 40 public class SearchEngineResult extends Region { 41 46 public int rank = 0; 47 48 53 public double score = 0.0; 54 55 58 public String title; 59 60 64 public String description; 65 66 69 public Link link; 70 71 74 public SearchEngine searchengine; 75 76 81 public SearchEngineResult (Region result) { 82 super (result); 83 rank = result.getNumericLabel ("rank", new Integer (0)).intValue(); 84 score = result.getNumericLabel ("score", new Double (0)).doubleValue(); 85 title = result.getLabel ("title"); 86 description = result.getLabel ("description"); 87 88 try { 89 link = (Link)result.getField ("link"); 90 } catch (ClassCastException e) {} 91 searchengine = (SearchEngine)result.getSource().getObjectLabel ("searchengine.source"); 92 } 93 94 public String toString () { 95 return rank + ". " + title + " [" + (link!=null ? link.getURL ().toString() : "(null)") + "]" + " " + score + "\n" 96 + " " + description; 97 } 98 } 99
| Popular Tags
|