Class MapContext
- java.lang.Object
-
- com.yahoo.searchlib.rankingexpression.evaluation.Context
-
- com.yahoo.searchlib.rankingexpression.evaluation.MapContext
-
-
Constructor Summary
Constructors Constructor Description MapContext()
MapContext(Value missingValue)
MapContext(Map<String,Value> bindings)
MapContext(Map<String,Value> bindings, Value missingValue)
Creates a map context from a map.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Value>
bindings()
Returns an immutable view of the bindings of this.MapContext
freeze()
Freezes this.static MapContext
fromString(String contextString)
A convenience constructor which returns a map context from a string on the formname1:value1, name2:value2 ...
.Value
get(String key)
Returns the value of a key.com.yahoo.tensor.TensorType
getType(Reference key)
Returns the type of the given value key, or null if it is not bound.Set<String>
names()
Returns an unmodifiable map of the names of thisvoid
put(String key, Value value)
Sets the value of a key.MapContext
thawedCopy()
Returns a new, modifiable context containing all the bindings of thisString
toString()
-
-
-
Constructor Detail
-
MapContext
public MapContext()
-
MapContext
public MapContext(Value missingValue)
-
-
Method Detail
-
freeze
public MapContext freeze()
Freezes this. Returns this for convenience.
-
getType
public com.yahoo.tensor.TensorType getType(Reference key)
Returns the type of the given value key, or null if it is not bound.
-
get
public Value get(String key)
Returns the value of a key. 0 is returned if the given key is not bound in this.
-
thawedCopy
public MapContext thawedCopy()
Returns a new, modifiable context containing all the bindings of this
-
fromString
public static MapContext fromString(String contextString)
A convenience constructor which returns a map context from a string on the formname1:value1, name2:value2 ...
. Extra spaces are allowed anywhere. Any other deviation from the syntax causes an exception to be thrown.
-
-