aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/schema/derived/NativeRankTypeDefinition.java
blob: 409ddc1d95b9073453391f1fd495c332d3430ea3 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.schema.derived;

import com.yahoo.schema.document.RankType;

import java.util.Collections;
import java.util.Iterator;
import java.util.List;

/**
 * The definition of a rank type used for native rank features.
 *
 * @author geirst
 */
public class NativeRankTypeDefinition {

    /** The type this defines */
    private RankType type;

    /** The rank tables of this rank type */
    private List<NativeTable> rankTables = new java.util.ArrayList<>();

    public NativeRankTypeDefinition(RankType type) {
        this.type = type;
    }

    public RankType getType() {
        return type;
    }

    public void addTable(NativeTable table) {
        rankTables.add(table);
    }

    /** Returns an unmodifiable list of the tables in this type definition */
    public Iterator<NativeTable> rankSettingIterator() {
        return Collections.unmodifiableList(rankTables).iterator();
    }

    public String toString() {
        return "native definition of rank type '" + type + "'";
    }

}