Class Resolution
- java.lang.Object
-
- com.yahoo.search.pagetemplates.engine.Resolution
-
public class Resolution extends java.lang.Object
A resolution of choices within a template.- Author:
- bratseth
-
-
Constructor Summary
Constructors Constructor Description Resolution()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChoiceResolution(Choice choice, int alternativeIndex)
void
addMapChoiceResolution(MapChoice choice, java.util.Map<java.lang.String,java.util.List<PageElement>> mapping)
int
getResolution(Choice choice)
Returns the resolution of a choice.java.util.Map<java.lang.String,java.util.List<PageElement>>
getResolution(MapChoice choice)
Returns the resolution of a map choice.java.lang.String
toString()
-
-
-
Method Detail
-
addChoiceResolution
public void addChoiceResolution(Choice choice, int alternativeIndex)
-
addMapChoiceResolution
public void addMapChoiceResolution(MapChoice choice, java.util.Map<java.lang.String,java.util.List<PageElement>> mapping)
-
getResolution
public int getResolution(Choice choice)
Returns the resolution of a choice.- Returns:
- the (0-base) index of the choice made. If the given choice has exactly one alternative, 0 is always returned (whether or not the choice has been attempted resolved).
- Throws:
java.lang.IllegalArgumentException
- if the choice is empty, or if it has multiple alternatives but have not been resolved in this
-
getResolution
public java.util.Map<java.lang.String,java.util.List<PageElement>> getResolution(MapChoice choice)
Returns the resolution of a map choice.- Returns:
- the chosen mapping - entries from placeholder id to the values to use at the location of that placeholder
- Throws:
java.lang.IllegalArgumentException
- if this choice has not been resolved in this
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-