aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/main/java/com/yahoo/searchlib/treenet/rule/Response.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/treenet/rule/Response.java
Publish
Diffstat (limited to 'searchlib/src/main/java/com/yahoo/searchlib/treenet/rule/Response.java')
-rwxr-xr-xsearchlib/src/main/java/com/yahoo/searchlib/treenet/rule/Response.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/searchlib/src/main/java/com/yahoo/searchlib/treenet/rule/Response.java b/searchlib/src/main/java/com/yahoo/searchlib/treenet/rule/Response.java
new file mode 100755
index 00000000000..347dd84f419
--- /dev/null
+++ b/searchlib/src/main/java/com/yahoo/searchlib/treenet/rule/Response.java
@@ -0,0 +1,45 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.searchlib.treenet.rule;
+
+/**
+ * @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen</a>
+ */
+public class Response extends TreeNode {
+
+ // The id of the next tree to run after this.
+ private final Double value;
+
+ // The value of this response.
+ private final String next;
+
+ /**
+ * Constructs a new response.
+ *
+ * @param next The id of the next tree to run after this.
+ * @param value The value of this response.
+ */
+ public Response(Double value, String next) {
+ super();
+ this.value = value;
+ this.next = next;
+ }
+
+ /**
+ * Returns the value of this response.
+ */
+ public Double getValue() {
+ return value;
+ }
+
+ /**
+ * Returns the id of the next tree to run after this.
+ */
+ public String getNext() {
+ return next;
+ }
+
+ @Override
+ public String toRankingExpression() {
+ return value.toString();
+ }
+}