From d7e1e3b5b24b0f9f0e3dfcc6d1e37d442f1de4e8 Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Sat, 17 Feb 2018 16:32:51 +0100 Subject: Static type check reference parameters --- .../src/main/java/com/yahoo/tensor/evaluation/EvaluationContext.java | 2 +- .../main/java/com/yahoo/tensor/evaluation/MapEvaluationContext.java | 4 +--- vespajlib/src/main/java/com/yahoo/tensor/evaluation/TypeContext.java | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) (limited to 'vespajlib/src/main/java') diff --git a/vespajlib/src/main/java/com/yahoo/tensor/evaluation/EvaluationContext.java b/vespajlib/src/main/java/com/yahoo/tensor/evaluation/EvaluationContext.java index 3fb94f1251b..8a969180113 100644 --- a/vespajlib/src/main/java/com/yahoo/tensor/evaluation/EvaluationContext.java +++ b/vespajlib/src/main/java/com/yahoo/tensor/evaluation/EvaluationContext.java @@ -10,7 +10,7 @@ import com.yahoo.tensor.Tensor; * @author bratseth */ @Beta -public interface EvaluationContext extends TypeContext { +public interface EvaluationContext extends TypeContext { /** Returns the tensor bound to this name, or null if none */ Tensor getTensor(String name); diff --git a/vespajlib/src/main/java/com/yahoo/tensor/evaluation/MapEvaluationContext.java b/vespajlib/src/main/java/com/yahoo/tensor/evaluation/MapEvaluationContext.java index 078f2e39815..74457a163fd 100644 --- a/vespajlib/src/main/java/com/yahoo/tensor/evaluation/MapEvaluationContext.java +++ b/vespajlib/src/main/java/com/yahoo/tensor/evaluation/MapEvaluationContext.java @@ -11,12 +11,10 @@ import java.util.HashMap; * @author bratseth */ @Beta -public class MapEvaluationContext implements EvaluationContext { +public class MapEvaluationContext implements EvaluationContext { private final java.util.Map bindings = new HashMap<>(); - static MapEvaluationContext empty() { return new MapEvaluationContext(); } - public void put(String name, Tensor tensor) { bindings.put(name, tensor); } @Override diff --git a/vespajlib/src/main/java/com/yahoo/tensor/evaluation/TypeContext.java b/vespajlib/src/main/java/com/yahoo/tensor/evaluation/TypeContext.java index ecb3a801324..3674b373db0 100644 --- a/vespajlib/src/main/java/com/yahoo/tensor/evaluation/TypeContext.java +++ b/vespajlib/src/main/java/com/yahoo/tensor/evaluation/TypeContext.java @@ -8,7 +8,7 @@ import com.yahoo.tensor.TensorType; * * @author bratseth */ -public interface TypeContext { +public interface TypeContext { /** * Returns the type of the tensor with this name. @@ -16,7 +16,7 @@ public interface TypeContext { * @return returns the type of the tensor which will be returned by calling getTensor(name) * or null if getTensor will return null. */ - TensorType getType(Name name); + TensorType getType(NAMETYPE name); /** A name which is just a string. Names are value objects. */ class Name { -- cgit v1.2.3