diff options
Diffstat (limited to 'config-model/src/main/java/com/yahoo/schema/derived/NativeRankTypeDefinition.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/schema/derived/NativeRankTypeDefinition.java | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/config-model/src/main/java/com/yahoo/schema/derived/NativeRankTypeDefinition.java b/config-model/src/main/java/com/yahoo/schema/derived/NativeRankTypeDefinition.java new file mode 100644 index 00000000000..7d558ea51cc --- /dev/null +++ b/config-model/src/main/java/com/yahoo/schema/derived/NativeRankTypeDefinition.java @@ -0,0 +1,44 @@ +// Copyright Yahoo. 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 + "'"; + } + +} |