Class ResultSetImpl

    • Field Detail

      • offset

        protected final int offset
      • range

        protected final int range
        0 means all results
      • totalHits

        protected final int totalHits
      • pageHits

        protected final int pageHits
      • query

        protected final String query
      • sqlQuery

        protected final SQLQuery sqlQuery
      • detachResultsFlag

        protected Boolean detachResultsFlag
    • Constructor Detail

      • ResultSetImpl

        public ResultSetImpl​(String query,
                             CoreSession session,
                             int offset,
                             int range,
                             List<ResultItem> resultItems,
                             int totalHits,
                             int pageHits)
        Constructor used when a CoreSession is available.
    • Method Detail

      • detachResults

        public boolean detachResults()
      • getOffset

        public int getOffset()
        Description copied from interface: ResultSet
        Returns the current offset for this result set.
        Specified by:
        getOffset in interface ResultSet
        Returns:
        the offset as an integer.
      • getRange

        public int getRange()
        Description copied from interface: ResultSet
        Returns the amount of results from offset requested.
        Specified by:
        getRange in interface ResultSet
        Returns:
        the amount of results from offset requested.
      • getTotalHits

        public int getTotalHits()
        Description copied from interface: ResultSet
        Returns the total number of hits this resultset comes from.
        Specified by:
        getTotalHits in interface ResultSet
        Returns:
        an integer value
      • getPageHits

        public int getPageHits()
        Description copied from interface: ResultSet
        Returns the amount of actual matching results.

        This is in contrast to getRange() that returns the maximum number of results per page.

        Specified by:
        getPageHits in interface ResultSet
        Returns:
        the amount of actual matching results.
      • hasNextPage

        public boolean hasNextPage()
        Description copied from interface: ResultSet
        Is there another page available?
        Specified by:
        hasNextPage in interface ResultSet
        Returns:
        true if next page available / false if not.
      • isFirstPage

        public boolean isFirstPage()
        Description copied from interface: ResultSet
        Is this result set the first page of results?
        Specified by:
        isFirstPage in interface ResultSet
        Returns:
        true if first page / false of not.
      • replay

        public ResultSet replay​(int offset,
                                int range)
                         throws SearchException
        Description copied from interface: ResultSet
        Replays the same query with new offset and range.
        Specified by:
        replay in interface ResultSet
        Parameters:
        offset - the new offset
        range - the new range
        Returns:
        a new, updated ResultSet
        Throws:
        SearchException
      • getPageNumber

        public int getPageNumber()
        Description copied from interface: ResultSet
        Computes the page number among the total set of results.
        Specified by:
        getPageNumber in interface ResultSet
        Returns:
        the page number