Class RandomResolver

java.lang.Object
com.yahoo.component.AbstractComponent
com.yahoo.search.pagetemplates.engine.Resolver
com.yahoo.search.pagetemplates.engine.resolvers.RandomResolver
All Implemented Interfaces:
com.yahoo.component.Component, com.yahoo.component.Deconstructable, Comparable<com.yahoo.component.Component>

public class RandomResolver extends Resolver
A resolver which makes all choices by random. The id of this is native.random.
Author:
bratseth
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from class com.yahoo.component.AbstractComponent

    isDeconstructable
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
     
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    resolve(Choice choice, Query query, Result result, Resolution resolution)
    Chooses the last alternative of any choice
    void
    resolve(MapChoice choice, Query query, Result result, Resolution resolution)
    Chooses a mapping which is always by the literal order given in the source template

    Methods inherited from class com.yahoo.search.pagetemplates.engine.Resolver

    resolve

    Methods inherited from class com.yahoo.component.AbstractComponent

    clone, compareTo, deconstruct, getClassName, getId, getIdString, hasInitializedId, initId, isDeconstructable, setIsDeconstructable, toString

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • RandomResolver

      public RandomResolver()
    • RandomResolver

      protected RandomResolver(String id)
  • Method Details

    • resolve

      public void resolve(Choice choice, Query query, Result result, Resolution resolution)
      Chooses the last alternative of any choice
      Overrides:
      resolve in class Resolver
      Parameters:
      choice - the choice to resolve
      query - the query for which this should be resolved, typically used to extract features
      result - the result for which this should be resolved, typically used to extract features
      resolution - the set of resolutions made so far, to which this should be added: resolution.addChoiceResolution(choice,chosenAlternativeIndex)
    • resolve

      public void resolve(MapChoice choice, Query query, Result result, Resolution resolution)
      Chooses a mapping which is always by the literal order given in the source template
      Overrides:
      resolve in class Resolver
      Parameters:
      choice - the choice to resolve
      query - the query for which this should be resolved, typically used to extract features
      result - the result for which this should be resolved, typically used to extract features
      resolution - the set of resolutions made so far, to which this should be added: resolution.addMapChoiceResolution(choice,chosenMapping)