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

/**
 * @author Simon Thoresen Hult
 */
public abstract class TreeNode {

    // The parent tree of this.
    private Tree parent = null;

    /**
     * Returns the parent tree of this.
     */
    public Tree getParent() {
        return parent;
    }

    /**
     * Sets the parent tree net of this.
     *
     * @param parent The parent tree net.
     * @return This, to allow chaining.
     */
    public TreeNode setParent(Tree parent) {
        this.parent = parent;
        return this;
    }

    /**
     * Returns a ranking expression equivalent of this net.
     */
    public abstract String toRankingExpression();
}