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>
A resolver which makes all choices by random.
The id of this is
native.random
.- Author:
- bratseth
-
Field Summary
Fields inherited from class com.yahoo.component.AbstractComponent
isDeconstructable
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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 templateMethods inherited from class com.yahoo.component.AbstractComponent
clone, compareTo, deconstruct, getClassName, getId, getIdString, hasInitializedId, initId, isDeconstructable, setIsDeconstructable, toString
-
Field Details
-
nativeId
- See Also:
-
-
Constructor Details
-
RandomResolver
public RandomResolver() -
RandomResolver
-
-
Method Details
-
resolve
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
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)
-