Class Cluster


  • public class Cluster
    extends java.lang.Object

    A contextual navigation cluster (belongs to a Category).

    For example if the query is "King", a cluster could be "King Richard". It's usually displayed "... Richard" on search results.

    Since:
    11.0
    See Also:
    ContextualNavigation, Category, ClusterNav
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Cluster.Schema
      Constants for the PADRE XML result packet tags.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Integer count
      Number of results for this suggestion
      private java.lang.String href
      Link to run a query using this cluster as query terms.
      private java.lang.String label
      Label of this suggestion (Ex: "...
      private java.lang.String query
      Query term for this suggestion (Ex: "King Richard" for the query "King").
      private static java.util.regex.Pattern QUERY_PATTERN
      Pattern used to find the query for this cluster from the query string.
    • Constructor Summary

      Constructors 
      Constructor Description
      Cluster()  
      Cluster​(java.lang.String href, java.lang.Integer count, java.lang.String label)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Integer getCount()
      Number of results for this suggestion
      java.lang.String getHref()
      Link to run a query using this cluster as query terms.
      java.lang.String getLabel()
      Label of this suggestion (Ex: "...
      java.lang.String getQuery()
      Query term for this suggestion (Ex: "King Richard" for the query "King").
      void setCount​(java.lang.Integer count)
      Number of results for this suggestion
      void setHref​(java.lang.String href)
      Sets the href of this suggestion and extracts the query terms into query.
      void setLabel​(java.lang.String label)
      Label of this suggestion (Ex: "...
      void setQuery​(java.lang.String query)
      Query term for this suggestion (Ex: "King Richard" for the query "King").
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • QUERY_PATTERN

        private static final java.util.regex.Pattern QUERY_PATTERN
        Pattern used to find the query for this cluster from the query string.
      • href

        private java.lang.String href
        Link to run a query using this cluster as query terms.
      • count

        private java.lang.Integer count
        Number of results for this suggestion
      • label

        private java.lang.String label
        Label of this suggestion (Ex: "... Richard" for the query "King").
      • query

        private java.lang.String query
        Query term for this suggestion (Ex: "King Richard" for the query "King").
    • Constructor Detail

      • Cluster

        public Cluster​(java.lang.String href,
                       java.lang.Integer count,
                       java.lang.String label)
      • Cluster

        public Cluster()
    • Method Detail

      • setHref

        public void setHref​(java.lang.String href)
        Sets the href of this suggestion and extracts the query terms into query.
        Parameters:
        href - URL to use for this suggestion.
      • getHref

        public java.lang.String getHref()
        Link to run a query using this cluster as query terms.
      • getCount

        public java.lang.Integer getCount()
        Number of results for this suggestion
      • setCount

        public void setCount​(java.lang.Integer count)
        Number of results for this suggestion
      • getLabel

        public java.lang.String getLabel()
        Label of this suggestion (Ex: "... Richard" for the query "King").
      • setLabel

        public void setLabel​(java.lang.String label)
        Label of this suggestion (Ex: "... Richard" for the query "King").
      • getQuery

        public java.lang.String getQuery()
        Query term for this suggestion (Ex: "King Richard" for the query "King").
      • setQuery

        public void setQuery​(java.lang.String query)
        Query term for this suggestion (Ex: "King Richard" for the query "King").