aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/main/java/com/yahoo/searchlib/expression/SingleResultNode.java
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
commit72231250ed81e10d66bfe70701e64fa5fe50f712 (patch)
tree2728bba1131a6f6e5bdf95afec7d7ff9358dac50 /searchlib/src/main/java/com/yahoo/searchlib/expression/SingleResultNode.java
Publish
Diffstat (limited to 'searchlib/src/main/java/com/yahoo/searchlib/expression/SingleResultNode.java')
-rw-r--r--searchlib/src/main/java/com/yahoo/searchlib/expression/SingleResultNode.java38
1 files changed, 38 insertions, 0 deletions
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 <a href="mailto:balder@yahoo-inc.com">Henning Baldersheim</a>
+ */
+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();
+}