Class MapEvaluationTypeContext

java.lang.Object
com.yahoo.searchlib.rankingexpression.rule.FunctionReferenceContext
com.yahoo.schema.MapEvaluationTypeContext
All Implemented Interfaces:
com.yahoo.tensor.evaluation.TypeContext<com.yahoo.searchlib.rankingexpression.Reference>

public class MapEvaluationTypeContext extends com.yahoo.searchlib.rankingexpression.rule.FunctionReferenceContext implements com.yahoo.tensor.evaluation.TypeContext<com.yahoo.searchlib.rankingexpression.Reference>
A context which only contains type information. This returns empty tensor types (double) for unknown features which are not query, attribute or constant features, as we do not have information about which such features exist (but we know those that exist are doubles). This is not multithread safe.
Author:
bratseth
  • Method Summary

    Modifier and Type
    Method
    Description
    com.yahoo.tensor.TensorType
    defaultTypeOf(com.yahoo.searchlib.rankingexpression.Reference reference)
    Returns the default type for this simple feature, or null if it does not have a default
    Map<com.yahoo.searchlib.rankingexpression.Reference,com.yahoo.tensor.TensorType>
     
    void
     
    com.yahoo.tensor.TensorType
    getType(com.yahoo.searchlib.rankingexpression.Reference reference)
     
    com.yahoo.tensor.TensorType
    getType(String reference)
     
    SortedSet<com.yahoo.searchlib.rankingexpression.Reference>
    Returns an unmodifiable view of the query features which was requested but for which we have no type info (such that they default to TensorType.empty), shared between all instances of this involved in resolving a particular rank profile.
    void
    setType(com.yahoo.searchlib.rankingexpression.Reference reference, com.yahoo.tensor.TensorType type)
     
    boolean
    Returns true if any feature across all instances involved in resolving this rank profile resolves to a tensor
     

    Methods inherited from class com.yahoo.searchlib.rankingexpression.rule.FunctionReferenceContext

    getBinding, getFunction, getFunctions, withoutBindings

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • setType

      public void setType(com.yahoo.searchlib.rankingexpression.Reference reference, com.yahoo.tensor.TensorType type)
    • featureTypes

      public Map<com.yahoo.searchlib.rankingexpression.Reference,com.yahoo.tensor.TensorType> featureTypes()
    • getType

      public com.yahoo.tensor.TensorType getType(String reference)
      Specified by:
      getType in interface com.yahoo.tensor.evaluation.TypeContext<com.yahoo.searchlib.rankingexpression.Reference>
    • forgetResolvedTypes

      public void forgetResolvedTypes()
    • getType

      public com.yahoo.tensor.TensorType getType(com.yahoo.searchlib.rankingexpression.Reference reference)
      Specified by:
      getType in interface com.yahoo.tensor.evaluation.TypeContext<com.yahoo.searchlib.rankingexpression.Reference>
    • defaultTypeOf

      public com.yahoo.tensor.TensorType defaultTypeOf(com.yahoo.searchlib.rankingexpression.Reference reference)
      Returns the default type for this simple feature, or null if it does not have a default
    • queryFeaturesNotDeclared

      public SortedSet<com.yahoo.searchlib.rankingexpression.Reference> queryFeaturesNotDeclared()
      Returns an unmodifiable view of the query features which was requested but for which we have no type info (such that they default to TensorType.empty), shared between all instances of this involved in resolving a particular rank profile.
    • tensorsAreUsed

      public boolean tensorsAreUsed()
      Returns true if any feature across all instances involved in resolving this rank profile resolves to a tensor
    • withBindings

      public MapEvaluationTypeContext withBindings(Map<String,String> bindings)
      Overrides:
      withBindings in class com.yahoo.searchlib.rankingexpression.rule.FunctionReferenceContext