Class Presentation

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class Presentation
    extends java.lang.Object
    implements java.lang.Cloneable
    Parameters deciding how the result of a query should be presented
    Author:
    Arne Bergene Fossaa
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String BOLDING  
      static java.lang.String FORMAT
      The (short) name of the parameter holding the name of the return format to use
      static java.lang.String PRESENTATION  
      static java.lang.String SUMMARY  
      static java.lang.String SUMMARY_FIELDS  
      static java.lang.String TIMING  
    • Constructor Summary

      Constructors 
      Constructor Description
      Presentation​(Query parent)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()  
      boolean equals​(java.lang.Object o)  
      static QueryProfileType getArgumentType()  
      boolean getBolding()
      Returns whether matching query terms should be bolded in the result.
      java.lang.String getFormat()
      Get the name of the format desired for result rendering.
      Highlight getHighlight()
      Returns how terms in this result should be highlighted, or null if not set
      com.yahoo.component.ComponentSpecification getRenderer()
      Get the name of the format desired for result rendering.
      java.lang.String getSummary()
      Returns the name of the summary class to be used to present hits from this query, or null if not set
      java.util.Set<java.lang.String> getSummaryFields()
      Return the set of explicitly requested fields.
      boolean getTiming()  
      int hashCode()  
      void prepare()
      Prepares this for binary serialization.
      void setBolding​(boolean bolding)
      Sets whether matching query terms should be bolded in the result
      void setFormat​(java.lang.String format)
      Set the desired format for result rendering.
      void setHighlight​(Highlight highlight)
      Sets how terms in this result should be highlighted.
      void setRenderer​(com.yahoo.component.ComponentSpecification format)
      Set the desired format for result rendering.
      void setSummary​(java.lang.String summary)
      Sets the name of the summary class to be used to present hits from this query
      void setSummaryFields​(java.lang.String asString)
      Parse the given string as a comma delimited set of field names and overwrite the set of summary fields.
      void setTiming​(boolean timing)  
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Presentation

        public Presentation​(Query parent)
    • Method Detail

      • getHighlight

        public Highlight getHighlight()
        Returns how terms in this result should be highlighted, or null if not set
      • setHighlight

        public void setHighlight​(Highlight highlight)
        Sets how terms in this result should be highlighted. Set to null to turn highlighting off
      • getSummary

        public java.lang.String getSummary()
        Returns the name of the summary class to be used to present hits from this query, or null if not set
      • setSummary

        public void setSummary​(java.lang.String summary)
        Sets the name of the summary class to be used to present hits from this query
      • getBolding

        public boolean getBolding()
        Returns whether matching query terms should be bolded in the result. Default is true.
      • setBolding

        public void setBolding​(boolean bolding)
        Sets whether matching query terms should be bolded in the result
      • getRenderer

        public com.yahoo.component.ComponentSpecification getRenderer()
        Get the name of the format desired for result rendering.
      • setRenderer

        public void setRenderer​(com.yahoo.component.ComponentSpecification format)
        Set the desired format for result rendering. If null, use the default renderer.
      • getFormat

        public java.lang.String getFormat()
        Get the name of the format desired for result rendering.
      • setFormat

        public void setFormat​(java.lang.String format)
        Set the desired format for result rendering. If null, use the default renderer.
      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getTiming

        public boolean getTiming()
        Returns:
        whether to add optional timing data to the rendered result
      • setTiming

        public void setTiming​(boolean timing)
      • getSummaryFields

        public java.util.Set<java.lang.String> getSummaryFields()
        Return the set of explicitly requested fields. Returns an empty set if no fields are specified outside of summary classes. The returned set is mutable and fields may be added or removed before passing on the query.
        Returns:
        the set of names of requested fields, never null
      • prepare

        public void prepare()
        Prepares this for binary serialization. For internal use - see Query.prepare()
      • setSummaryFields

        public void setSummaryFields​(java.lang.String asString)
        Parse the given string as a comma delimited set of field names and overwrite the set of summary fields. Whitespace will be trimmed. If you want to add or remove fields programmatically, use getSummaryFields() and modify the returned set.
        Parameters:
        asString - the summary fields requested, e.g. "price,author,title"