aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/main/java/com/yahoo/searchlib/expression/PositiveInfinityResultNode.java
blob: 3ed5345ba22067b6136e6d82c890231669cf266e (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.searchlib.expression;

/**
 * @author baldersheim
 */
public class PositiveInfinityResultNode extends ResultNode {
    // The global class identifier shared with C++.
    public static final int classId = registerClass(0x4000 + 124, PositiveInfinityResultNode.class);

    @Override
    protected int onGetClassId() {
        return classId;
    }

    @Override
    public long getInteger() {
        return Long.MAX_VALUE;
    }

    @Override
    public double getFloat() {
        return Double.MAX_VALUE;
    }

    @Override
    public byte[] getRaw() {
        return new byte[0];
    }

    @Override
    public String getString() {
        return "";
    }

    @Override
    protected int onCmp(ResultNode rhs) {
        return rhs instanceof PositiveInfinityResultNode ? 0 : 1;
    }

    @Override
    public void set(ResultNode rhs) {
    }
}