Class Resolution

java.lang.Object
com.yahoo.search.pagetemplates.engine.Resolution

public class Resolution extends Object
A resolution of choices within a template.
Author:
bratseth
  • Constructor Details

    • Resolution

      public Resolution()
  • Method Details

    • addChoiceResolution

      public void addChoiceResolution(Choice choice, int alternativeIndex)
    • addMapChoiceResolution

      public void addMapChoiceResolution(MapChoice choice, Map<String,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:
      IllegalArgumentException - if the choice is empty, or if it has multiple alternatives but have not been resolved in this
    • getResolution

      public Map<String,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:
      IllegalArgumentException - if this choice has not been resolved in this
    • toString

      public String toString()
      Overrides:
      toString in class Object