001: /*
002: * $Id: SearchResultEntry.java 644 2006-04-23 07:52:28Z wrh2 $
003: *
004: * Filename : SearchResultEntry.java
005: * Project : VQWiki
006: * Auhtor : Tobias Schulz-Hess (sourceforge@schulz-hess.de)
007: */
008: package vqwiki;
009:
010: /**
011: * bean, which contains one search result entry
012: *
013: * This class was created on 09:58:54 14.04.2003
014: *
015: * @author Tobias Schulz-Hess (sourceforge@schulz-hess.de)
016: */
017: public class SearchResultEntry {
018:
019: /** The topic of this entry */
020: private String topic = "";
021: /** Text before found text */
022: private String textBefore = "";
023: /** the found word */
024: private String foundWord = "";
025: /** the text after the found word */
026: private String textAfter = "";
027: /** the hit ranking */
028: private float ranking = 0.0f;
029:
030: /**
031: * @return
032: */
033: public String getFoundWord() {
034: return foundWord;
035: }
036:
037: /**
038: * @return
039: */
040: public float getRanking() {
041: return ranking;
042: }
043:
044: /**
045: * @return
046: */
047: public String getTextAfter() {
048: return textAfter;
049: }
050:
051: /**
052: * @return
053: */
054: public String getTextBefore() {
055: return textBefore;
056: }
057:
058: /**
059: * @return
060: */
061: public String getTopic() {
062: return topic;
063: }
064:
065: /**
066: * @param string
067: */
068: public void setFoundWord(String string) {
069: foundWord = string;
070: }
071:
072: /**
073: * @param f
074: */
075: public void setRanking(float f) {
076: ranking = f;
077: }
078:
079: /**
080: * @param string
081: */
082: public void setTextAfter(String string) {
083: textAfter = string;
084: }
085:
086: /**
087: * @param string
088: */
089: public void setTextBefore(String string) {
090: textBefore = string;
091: }
092:
093: /**
094: * @param string
095: */
096: public void setTopic(String string) {
097: topic = string;
098: }
099:
100: /**
101: * Equals
102: * @param o the other object
103: * @return equal o
104: */
105: public boolean equals(Object o) {
106: if (this == o)
107: return true;
108: if (!(o instanceof SearchResultEntry))
109: return false;
110: final SearchResultEntry searchResultEntry = (SearchResultEntry) o;
111: if (ranking != searchResultEntry.ranking)
112: return false;
113: if (foundWord != null ? !foundWord
114: .equals(searchResultEntry.foundWord)
115: : searchResultEntry.foundWord != null)
116: return false;
117: if (textAfter != null ? !textAfter
118: .equals(searchResultEntry.textAfter)
119: : searchResultEntry.textAfter != null)
120: return false;
121: if (textBefore != null ? !textBefore
122: .equals(searchResultEntry.textBefore)
123: : searchResultEntry.textBefore != null)
124: return false;
125: if (topic != null ? !topic.equals(searchResultEntry.topic)
126: : searchResultEntry.topic != null)
127: return false;
128: return true;
129: }
130:
131: /**
132: * Hashcode
133: * @return hashcode
134: */
135: public int hashCode() {
136: int result;
137: result = (topic != null ? topic.hashCode() : 0);
138: result = 29 * result
139: + (textBefore != null ? textBefore.hashCode() : 0);
140: result = 29 * result
141: + (foundWord != null ? foundWord.hashCode() : 0);
142: result = 29 * result
143: + (textAfter != null ? textAfter.hashCode() : 0);
144: result = 29 * result + Float.floatToIntBits(ranking);
145: return result;
146: }
147: }
148:
149: /*
150: * Log:
151: *
152: * $Log$
153: * Revision 1.4 2006/04/23 07:52:28 wrh2
154: * Coding style updates (VQW-73).
155: *
156: * Revision 1.3 2004/02/28 04:05:42 garethc
157: * General bug fixes, panic on admin console
158: *
159: * Revision 1.2 2003/04/15 23:11:02 garethc
160: * lucene fixes
161: *
162: * Revision 1.1 2003/04/15 08:41:32 mrgadget4711
163: * ADD: Lucene search
164: * ADD: RSS Stream
165: *
166: * ------------END------------
167: */
|