code: public Map<Integer, String> getPageLinks() {
  
          Map<Integer, String> links = new TreeMap<Integer, String>();
          if (m_pageCount <= 1) {
              return links;
          }
          int startIndex, endIndex;
          String link = m_cms.getRequestContext().getUri() + m_parameters.toQueryString() + "&searchPage=";
          if (getDisplayPages() < 1) {
              // number of displayed pages not limited, build a map with all available page links
              startIndex = 1;
              endIndex = m_pageCount;
          } else {
              // limited number of displayed pages, calculate page range
              int currentPage = getSearchPage();
              int countBeforeCurrent = getDisplayPages() / 2;
              int countAfterCurrent;
              if ((currentPage - countBeforeCurrent) < 1) {
                  // set count before to number of available pages
                  countBeforeCurrent = currentPage - 1;
              }
              // set count after to number of remaining pages (- 1 for current page)
              countAfterCurrent = getDisplayPages() - countBeforeCurrent - 1;
              // calculate start and end index
              startIndex = currentPage - countBeforeCurrent;
              endIndex = currentPage + countAfterCurrent;
              // check end index
              if (endIndex > m_pageCount) {
                  int delta = endIndex - m_pageCount;
                  // decrease start index with delta to get the right number of displayed pages
                  startIndex -= delta;
                  // check start index to avoid values < 1
                  if (startIndex < 1) {
                      startIndex = 1;
                  }
                  endIndex = m_pageCount;
              }
          }
  
          // build the sorted tree map of page links
          for (int i = startIndex; i <= endIndex; i++) {
              links.put(new Integer(i), (link + i));
          }
          return links;
      }
docs: Creates a sorted map of URLs to link to other search result pages.<p>
  
  The key values are Integers representing the page number, the entry
  holds the corresponding link.<p>
  
  @return a map with String URLs