From 72231250ed81e10d66bfe70701e64fa5fe50f712 Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Wed, 15 Jun 2016 23:09:44 +0200 Subject: Publish --- .../searchlib/expression/SingleResultNode.java | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 searchlib/src/main/java/com/yahoo/searchlib/expression/SingleResultNode.java (limited to 'searchlib/src/main/java/com/yahoo/searchlib/expression/SingleResultNode.java') diff --git a/searchlib/src/main/java/com/yahoo/searchlib/expression/SingleResultNode.java b/searchlib/src/main/java/com/yahoo/searchlib/expression/SingleResultNode.java new file mode 100644 index 00000000000..2c9b940cbf0 --- /dev/null +++ b/searchlib/src/main/java/com/yahoo/searchlib/expression/SingleResultNode.java @@ -0,0 +1,38 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.searchlib.expression; + +/** + * @author Henning Baldersheim + */ +public abstract class SingleResultNode extends ResultNode { + // The global class identifier shared with C++. + public static final int classId = registerClass(0x4000 + 121, NumericResultNode.class); + + /** + * In-place addition of this result with another. + * + * @param rhs The result to add to this. + */ + public abstract void add(ResultNode rhs); + + /** + * Swaps the numerical value of this node with the smaller of this and the other. + * + * @param rhs The other result to evaluate. + */ + public abstract void min(ResultNode rhs); + + /** + * Swaps the numerical value of this node with the larger of this and the other. + * + * @param rhs The other result to evaluate. + */ + public abstract void max(ResultNode rhs); + + /** + * Return a java native, either String, Double or Long, depending on the underlying container. + * + * @return The underlying numeric value. + */ + public abstract Object getValue(); +} -- cgit v1.2.3