|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PagedResultsList<E>
A ResultsList that pages through all of the results. This class contains a set of methods that allow you to navigate through all of the pages in a set of results. It only presents a single page of results at a time, which are available through the methods in the java.util.List interface (such as the get(int) method).
Here is some example usage:
PagedResultsList results = new PagedResultsArrayList();
results.setYahooSearch(yahooWebSearch);
results.refresh();
System.out.println(results.getNumPages());
...
if (results.hasNextPage()) {
results.nextPage();
System.out.println(results.size()); // number of results in this page
System.out.println(results.get(0)); // fetches and prints the first result on this page
}
| Method Summary | |
|---|---|
boolean |
firstPage()
Reloads this PagedResultsList by searching the YahooSearch component for the first page of results. |
int |
getNumPages()
|
boolean |
gotoPage(int index)
Reloads this PagedResultsList by searching the YahooSearch component for the given page of results. |
boolean |
isHasNextPage()
|
boolean |
isHasPreviousPage()
|
boolean |
lastPage()
Reloads this PagedResultsList by searching the YahooSearch component for the last page of results. |
boolean |
nextPage()
Reloads this PagedResultsList by searching the YahooSearch component for the next page of results. |
boolean |
previousPage()
Reloads this PagedResultsList by searching the YahooSearch component for the previous page of results. |
void |
refresh()
Reloads this PagedResultsList by searching the YahooSearch component for the current page of results. |
void |
setYahooSearch(YahooSearch search)
Sets the YahooSearch component to use for populating this PagedResultsList. |
| Methods inherited from interface org.jdesktop.swingx.ws.yahoo.search.ResultsList |
|---|
getFirstResultPosition, getTotalResultsAvailable, getYahooSearch |
| Methods inherited from interface java.util.List |
|---|
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray |
| Method Detail |
|---|
int getNumPages()
boolean nextPage()
Reloads this PagedResultsList by searching the YahooSearch component for the next page of results. If hasNextPage returns false, this method does nothing and returns false. If the YahooSearch component is not set, this method returns false.
This method blocks, and should only be called
from org.jdesktop.swingx.ws.BackgroundWorker or SwingWorker or another
background threading library.
boolean previousPage()
Reloads this PagedResultsList by searching the YahooSearch component for the previous page of results. If hasPrevPage returns false, this method does nothing and returns false. If the YahooSearch component is not set, this method returns false.
This method blocks, and should only be called
from org.jdesktop.swingx.ws.BackgroundWorker or SwingWorker or another
background threading library.
boolean firstPage()
Reloads this PagedResultsList by searching the YahooSearch component for the first page of results. If the YahooSearch component is not set, this method returns false.
This method blocks, and should only be called
from org.jdesktop.swingx.ws.BackgroundWorker or SwingWorker or another
background threading library.
boolean lastPage()
Reloads this PagedResultsList by searching the YahooSearch component for the last page of results. If the YahooSearch component is not set, this method returns false.
This method blocks, and should only be called
from org.jdesktop.swingx.ws.BackgroundWorker or SwingWorker or another
background threading library.
boolean gotoPage(int index)
Reloads this PagedResultsList by searching the YahooSearch component for the given page of results. The index is 0 based. If the YahooSearch component is not set, this method returns false.
This method blocks, and should only be called
from org.jdesktop.swingx.ws.BackgroundWorker or SwingWorker or another
background threading library.
index - a 0 based index of the page to load. If index > getNumPages(), then
an IllegalArgumentException is thrown. Likewise if index < 0.
boolean isHasPreviousPage()
boolean isHasNextPage()
void refresh()
Reloads this PagedResultsList by searching the YahooSearch component for the current page of results. If the YahooSearch component is not set, this method returns false.
This method blocks, and should only be called
from org.jdesktop.swingx.ws.BackgroundWorker or SwingWorker or another
background threading library.
void setYahooSearch(YahooSearch search)
search - the YahooSearch component to use for populating this PagedResultsList.
This may be null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||