aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/result/HitOrderer.java
blob: 01c6e897ea0fa4449a55040a8b351d5727159bdd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.result;

import java.util.Comparator;
import java.util.List;

/**
 * A class capable of ordering a list of hits
 *
 * @author bratseth
 */
public abstract class HitOrderer {

    /** Orders the given list of hits */
    public abstract void order(List<Hit> hits);

    /**
     * Returns the Comparator that this HitOrderer uses internally to sort hits. Returns null if no Comparator is used.
     * <p>
     * This default implementation returns null.
     *
     * @return the Comparator used to order hits, or null
     */
    public Comparator<Hit> getComparator() {
        return null;
    }

}