org.jdesktop.swingx.ws.yahoo.search
Interface ResultsList<E>

All Superinterfaces:
Collection<E>, Iterable<E>, List<E>
All Known Subinterfaces:
PagedResultsList<E>
All Known Implementing Classes:
PagedResultsArrayList, ResultsArrayList

public interface ResultsList<E>
extends List<E>

A java.util.List containing the list of search results. This List is generally constructed by the various YahooSearch subclasses during the readResults() phase of the search. It is not thought generally useful to create instances of this class yourself.

ResultsList differs from java.util.List in that it adds two methods: getTotalResultsAvailable() and getFirstResultPosition(). The values returned from this method are typically based on search results.

For example, suppose a search is performed that includes 100 results but only the results between 30(inclusive)-40(exclusive) are included. The results from these methods would be:

None of these values are required for using this List. Rather, they are useful when used to page through all of the totalResultsAvailable.

This interface adds one more important method, getYahooSearch() which returns the YahooSearch that was used to produce this search ResultsList. This allows some automated code to page through all the results, creating new searches as necessary.


Method Summary
 int getFirstResultPosition()
           
 int getTotalResultsAvailable()
           
 YahooSearch 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

getTotalResultsAvailable

int getTotalResultsAvailable()
Returns:
the total results available, not to be confused with the total results in this ResultsList. This method returns the total number of search results associated with the search that produced this ResultsList.

getFirstResultPosition

int getFirstResultPosition()
Returns:
the 1 based index into the totalResultsAvailable that this ResultsList is populated with. For example, if there are 100 total results, and this list contains results 30-40, then this method will return 30.

getYahooSearch

YahooSearch getYahooSearch()
Returns:
the YahooSearch that was used to produce this ResultsList. May be null.