blob: d84259f2643a71cf2503bb83fa1cb10a57e7bdc6 (
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
45
46
47
48
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.document.select.rule;
import com.yahoo.document.BucketIdFactory;
import com.yahoo.document.select.BucketSet;
import com.yahoo.document.select.Context;
import com.yahoo.document.select.OrderingSpecification;
import com.yahoo.document.select.Visitor;
/**
* This is the interface of all expression nodes. It declares the methods requires by all expression nodes to maintain
* a working document selector language.
*
* @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen</a>
*/
public interface ExpressionNode {
/**
* Evaluate the content of this node based on document object, and return that value.
*
* @param doc The document to evaluate over.
* @return The value of this.
*/
public Object evaluate(Context doc);
/**
* Returns the set of bucket ids covered by this node.
*
* @param factory The factory used by the current application.
*/
public BucketSet getBucketSet(BucketIdFactory factory);
/**
* If this document selection implies a specific ordering (using the orderdoc scheme),
* return that specification.
*
* @param order The order in which we are looking to traverse the ordering (ASCENDING or DESCENDING)
*/
public OrderingSpecification getOrdering(int order);
/**
* Perform visitation of this node.
*
* @param visitor The visitor that wishes to visit the node.
*/
public void accept(Visitor visitor);
}
|