com.browseengine.bobo.service.HitCompareMulti Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bobo-browse Show documentation
Show all versions of bobo-browse Show documentation
Bobo is a Faceted Search implementation written purely in Java, an extension of Apache Lucene
The newest version!
package com.browseengine.bobo.service;
import java.util.Comparator;
import com.browseengine.bobo.api.BrowseHit;
public class HitCompareMulti implements Comparator {
protected Comparator[] m_hcmp;
public HitCompareMulti(Comparator[] hcmp) {
m_hcmp = hcmp;
}
// HitCompare
public int compare(BrowseHit h1, BrowseHit h2) {
int retVal = 0;
for (int i = 0; i < m_hcmp.length; ++i) {
retVal = m_hcmp[i].compare(h1, h2);
if (retVal != 0) break;
}
return retVal;
}
}