@Test public void testCompareToSearchResultItem() { SearchResultItem nextItem = new SearchResultItemImpl(id, site, url, relevance + 1.0, source); assertTrue(item.compareTo(nextItem) > 0); }
public int compareTo(SearchResultItem sr) { if (score < sr.getRelevance()) return 1; else if (score > sr.getRelevance()) return -1; else if (getTitle() != null && sr.getTitle() != null) return getTitle().compareTo(sr.getTitle()); else return 0; }
SearchResultItemImpl implements SearchResultItem { public int compareTo(SearchResultItem sr) { if (score < sr.getRelevance()) return 1; else if (score > sr.getRelevance()) return -1; else if (getTitle() != null && sr.getTitle() != null) return getTitle().compareTo(sr.getTitle()); else return 0; } }
SearchResultItemImpl implements SearchResultItem { public int compareTo(SearchResultItem sr) { if (score < sr.getRelevance()) return 1; else if (score > sr.getRelevance()) return -1; else if (getTitle() != null && sr.getTitle() != null) return getTitle().compareTo(sr.getTitle()); else return 0; } SearchResultItemImpl(String id, Site site, WebUrl url,
      double relevance, Object source); }
SearchResultItemImpl implements SearchResultItem { public int compareTo(SearchResultItem sr) { if (score < sr.getRelevance()) return 1; else if (score > sr.getRelevance()) return -1; else if (getTitle() != null && sr.getTitle() != null) return getTitle().compareTo(sr.getTitle()); else return 0; } SearchResultItemImpl(String id, Site site, WebUrl url,
      double relevance, Object source); Site getSite(); void setId(String id); String getId(); void setTitle(String title); String getTitle(); void setUrl(WebUrl url); WebUrl getUrl(); void setPreview(Object preview); Object getContent(); PageletRenderer getRenderer(); void setRenderer(PageletRenderer renderer); void setPreviewRenderer(Renderer r); Renderer getPreviewRenderer(); void setRelevance(double relevance); double getRelevance(); Object getSource(); int compareTo(SearchResultItem sr); @Override boolean equals(Object obj); @Override int hashCode(); String toXml(); }
SearchResultItemImpl implements SearchResultItem { public int compareTo(SearchResultItem sr) { if (score < sr.getRelevance()) return 1; else if (score > sr.getRelevance()) return -1; else if (getTitle() != null && sr.getTitle() != null) return getTitle().compareTo(sr.getTitle()); else return 0; } SearchResultItemImpl(String id, Site site, WebUrl url,
      double relevance, Object source); Site getSite(); void setId(String id); String getId(); void setTitle(String title); String getTitle(); void setUrl(WebUrl url); WebUrl getUrl(); void setPreview(Object preview); Object getContent(); PageletRenderer getRenderer(); void setRenderer(PageletRenderer renderer); void setPreviewRenderer(Renderer r); Renderer getPreviewRenderer(); void setRelevance(double relevance); double getRelevance(); Object getSource(); int compareTo(SearchResultItem sr); @Override boolean equals(Object obj); @Override int hashCode(); String toXml();  }