| 1 43 package com.ivata.groupware.business.search.result; 44 45 import com.ivata.groupware.business.search.item.SearchItemDO; 46 47 57 58 public class SearchResult implements Comparable { 59 64 private SearchItemDO item; 65 66 71 private float weight; 72 80 public int compareTo(final Object compare) { 81 SearchResult otherResult = (SearchResult) compare; 82 if (otherResult.weight == weight) { 83 return 0; 84 } 85 if (otherResult.weight > weight) { 86 return 1; 87 } 88 return -1; 89 } 90 91 98 public final SearchItemDO getItem() { 99 return item; 100 } 101 108 public final float getWeight() { 109 return weight; 110 } 111 118 public final void setItem(final SearchItemDO item) { 119 this.item = item; 120 } 121 128 public final void setWeight(final float weight) { 129 this.weight = weight; 130 } 131 132 } 133 | Popular Tags |