|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD | |||||||
org.jdesktop.swingx.ws.yahoo.search.PagedResultsListjava.lang.Iterable
java.util.Collection
org.jdesktop.swingx.ws.yahoo.search.ResultsList
public interface PagedResultsList extends ResultsList
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()
|
int
|
getNumPages()
|
boolean
|
gotoPage(int index)
|
boolean
|
isHasNextPage()
|
boolean
|
isHasPreviousPage()
|
boolean
|
lastPage()
|
boolean
|
nextPage()
|
boolean
|
previousPage()
|
void
|
refresh()
|
void
|
setYahooSearch(YahooSearch search)
Sets the YahooSearch component to use for populating this PagedResultsList. |
| Methods inherited from interface ResultsList | |
|---|---|
| getFirstResultPosition, getTotalResultsAvailable, getYahooSearch |
| Methods inherited from interface List | |
|---|---|
| add, add, get, equals, hashCode, indexOf, clear, isEmpty, lastIndexOf, contains, addAll, addAll, size, toArray, toArray, iterator, remove, remove, set, listIterator, listIterator, subList, removeAll, containsAll, retainAll |
| Method Detail |
|---|
public 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.
public int getNumPages()
public 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.
public boolean isHasNextPage()
public boolean isHasPreviousPage()
public 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.
public 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.
public 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.
public 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.
public void setYahooSearch(YahooSearch search)
search - the YahooSearch component to use for populating this PagedResultsList.
This may be null.
Groovy Documentation