aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/prelude/semantics/engine/FlattenedItem.java
blob: 5d943c0a244d20607a4acd4063f8254b1987573a (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.prelude.semantics.engine;

import com.yahoo.prelude.query.TermItem;

/**
 * An item which knows its position in its parent
 *
 * @author bratseth
 */
public class FlattenedItem {

    private TermItem item;

    /** The position of this item in its parent */
    private int position;

    public FlattenedItem(TermItem item,int position) {
        this.item = item;
        this.position = position;
    }

    public TermItem getItem() { return item; }

    public int getPosition() { return position; }

    public String toString() {
        return position + ":" + item;
    }

}