aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/evaluation/ContextIndex.java
blob: a055fa278c0ab9dfbfd7b51b896ac0319acae9c6 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.searchlib.rankingexpression.evaluation;

/**
 * Indexed context lookup methods.
 * Any context which implements these methods supports optimizations where map lookups
 * are replaced by indexed lookups.
 *
 * @author bratseth
 */
public interface ContextIndex {

    /** Returns the number of bound variables in this */
    int size();

    /**
     * Returns the index from a name.
     *
     * @throws NullPointerException is this name is not known to this context
     */
    int getIndex(String name);

    Value get(int index);

    double getDouble(int index);

}