summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorJon Bratseth <jonbratseth@yahoo.com>2016-12-20 09:22:00 +0100
committerGitHub <noreply@github.com>2016-12-20 09:22:00 +0100
commit5f32c0369cf796e46b70576d2f4eb8e470edb0e6 (patch)
treef15261cc22786afe1bdbab63e9075970501e542b /searchlib
parent3cd484f5a35af1b2fda324e3787c741be02179fa (diff)
Revert "Revert "Bratseth/tensor subiterators""
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/evaluation/TensorValue.java26
1 files changed, 5 insertions, 21 deletions
diff --git a/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/evaluation/TensorValue.java b/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/evaluation/TensorValue.java
index 6b67fca791d..6d038113691 100644
--- a/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/evaluation/TensorValue.java
+++ b/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/evaluation/TensorValue.java
@@ -23,16 +23,9 @@ public class TensorValue extends Value {
/** The tensor value of this */
private final Tensor value;
- private final Optional<TensorType> type;
-
+
public TensorValue(Tensor value) {
this.value = value;
- this.type = Optional.empty();
- }
-
- public TensorValue(Tensor value, TensorType type) {
- this.value = value;
- this.type = Optional.of(type);
}
@Override
@@ -97,10 +90,6 @@ public class TensorValue extends Value {
public Tensor asTensor() { return value; }
- public Optional<TensorType> getType() {
- return type;
- }
-
@Override
public Value compare(TruthOperator operator, Value argument) {
return new TensorValue(compareTensor(operator, asTensor(argument, operator.toString())));
@@ -150,18 +139,13 @@ public class TensorValue extends Value {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
- TensorValue that = (TensorValue) o;
-
- if (!type.equals(that.type)) return false;
- if (!value.equals(that.value)) return false;
-
- return true;
+ TensorValue other = (TensorValue) o;
+ return value.equals(other.value);
}
@Override
public int hashCode() {
- int result = value.hashCode();
- result = 31 * result + type.hashCode();
- return result;
+ return value.hashCode();
}
+
}