org.shredzone.repowatch.web.util
Class BrowserData

java.lang.Object
  extended by org.shredzone.repowatch.web.util.BrowserData

public class BrowserData
extends Object

Contains all data required to show a page browser.

Version:
$Revision: 328 $

Constructor Summary
BrowserData()
           
 
Method Summary
 String getBaseurl()
          Returns the URL to be loaded when another page is to be shown.
 int getPage()
          Gets the page currently displayed.
 int getPagecount()
          Gets the number of pages to be shown.
 Iterator<Integer> getPageIterator()
          Returns an iterator that iterates thru a sequence of page numbers.
 String getPageparam()
          Returns the parameter name containing the page currently shown in this browser.
 int getPagesteps()
          Gets a good guess for large step increments.
 long getResultcount()
          Gets the number of entries of the result.
 void setBaseurl(String baseurl)
           
 void setPage(int page)
           
 void setPagecount(int pagecount)
           
 void setPageparam(String pageparam)
           
 void setResultcount(long resultcount)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrowserData

public BrowserData()
Method Detail

getPagecount

public int getPagecount()
Gets the number of pages to be shown.

Returns:
Number of pages

setPagecount

public void setPagecount(int pagecount)

getPagesteps

public int getPagesteps()
Gets a good guess for large step increments. This implementation depends on the current pagecount and always returns a decimal power in the magnitude of the pagecount.

Examples: pagecount=14, pagesteps=10. pagecount=321, pagesteps=100. pagecount=812312, pagesteps=100000.

For a pagecount of 0, 0 is be returned.

Returns:
Large step increments.

getPage

public int getPage()
Gets the page currently displayed.

Returns:
Page number currently displayed.

setPage

public void setPage(int page)

getResultcount

public long getResultcount()
Gets the number of entries of the result. This is only used as information to the user, and has no direct impact to the browser.

Returns:
Number of entries

setResultcount

public void setResultcount(long resultcount)

getBaseurl

public String getBaseurl()
Returns the URL to be loaded when another page is to be shown. This is usually the URL of the page currently shown.

Returns:
Base URL

setBaseurl

public void setBaseurl(String baseurl)

getPageparam

public String getPageparam()
Returns the parameter name containing the page currently shown in this browser. Usually "page".

Returns:
Page parameter name

setPageparam

public void setPageparam(String pageparam)

getPageIterator

public Iterator<Integer> getPageIterator()
Returns an iterator that iterates thru a sequence of page numbers. The sequence can be used in the browser fragment to select other page numbers.

The current state of the BrowserData is frozen in this iterator.

Note that the Iterator starts counting from 1 to make the result readable for humans, while the browser itself counts the page starting from zero.

Returns:
Iterator that iterates through a sequence of page numbers


Copyright © 2007-2011 shredzone.org. All Rights Reserved.