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 isnative.random
.- Author:
- bratseth
-
-
Constructor Summary
Constructors Modifier Constructor Description RandomResolver()
protected
RandomResolver(String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
resolve(Choice choice, Query query, Result result, Resolution resolution)
Chooses the last alternative of any choicevoid
resolve(MapChoice choice, Query query, Result result, Resolution resolution)
Chooses a mapping which is always by the literal order given in the source template
-
-
-
Field Detail
-
nativeId
public static final String nativeId
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RandomResolver
public RandomResolver()
-
RandomResolver
protected RandomResolver(String id)
-
-
Method Detail
-
resolve
public void resolve(Choice choice, Query query, Result result, Resolution resolution)
Chooses the last alternative of any choice- Overrides:
resolve
in classResolver
- Parameters:
choice
- the choice to resolvequery
- the query for which this should be resolved, typically used to extract featuresresult
- the result for which this should be resolved, typically used to extract featuresresolution
- 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 classResolver
- Parameters:
choice
- the choice to resolvequery
- the query for which this should be resolved, typically used to extract featuresresult
- the result for which this should be resolved, typically used to extract featuresresolution
- the set of resolutions made so far, to which this should be added:resolution.addMapChoiceResolution(choice,chosenMapping)
-
-