public abstract class Resolver
extends com.yahoo.component.AbstractComponent
Subclasses overrides one of the two resolve methods to either resolve each choices individually or look at all choices at once.
All subclasses of this must be multithread safe. I.e multiple calls may be made to resolve at the same time from different threads.
Modifier and Type | Class and Description |
---|---|
private class |
Resolver.ChoiceResolverVisitor |
Modifier | Constructor and Description |
---|---|
protected |
Resolver() |
|
Resolver(com.yahoo.component.ComponentId id) |
|
Resolver(String id) |
Modifier and Type | Method and Description |
---|---|
Resolution |
resolve(Choice pageTemplate,
Query query,
Result result)
Override this to resolve choices.
|
void |
resolve(Choice choice,
Query query,
Result result,
Resolution resolution)
Override this to resolve each choice independently.
|
void |
resolve(MapChoice choice,
Query query,
Result result,
Resolution resolution)
Override this to resolve each map choice independently.
|
public Resolver(String id)
public Resolver(com.yahoo.component.ComponentId id)
protected Resolver()
public Resolution resolve(Choice pageTemplate, Query query, Result result)
This default implementation creates a Resolution and calls
resolve(choice/mapChoice,query,result,resolution)
first on the given page template choice, then
on each choice found in that temnplate. This provides a simple API to resolvers which make each choice
independently.
pageTemplate
- the choice of page templates to resolve - a choice containing singleton lists of PageTemplate elementsquery
- the query, from which information useful for correct resolution can be foundresult
- the result, from which further information useful for correct resolution can be foundpublic void resolve(Choice choice, Query query, Result result, Resolution resolution)
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)
public void resolve(MapChoice choice, Query query, Result result, Resolution resolution)
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)
Copyright © 2018. All rights reserved.