org.jdesktop.swingx.ws.yahoo.search
Class ResultsArrayList<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<E>
              extended by org.jdesktop.swingx.ws.yahoo.search.ResultsArrayList<E>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess, ResultsList<E>

public class ResultsArrayList<E>
extends ArrayList<E>
implements ResultsList<E>

A basic implementation of ResultsList based on ArrayList. This object contains a constructor in which the totalResultsAvailable, firstResultPosition, and YahooSearch must be specified. These are immutable properties.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ResultsArrayList(YahooSearch search, int totalResultsAvailable, int firstResultPosition)
          Creates a new instance of ResultsArrayList
 
Method Summary
 int getFirstResultPosition()
           
 int getTotalResultsAvailable()
           
 YahooSearch getYahooSearch()
           
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
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
 

Constructor Detail

ResultsArrayList

public ResultsArrayList(YahooSearch search,
                        int totalResultsAvailable,
                        int firstResultPosition)
Creates a new instance of ResultsArrayList

Method Detail

getTotalResultsAvailable

public int getTotalResultsAvailable()
Specified by:
getTotalResultsAvailable in interface ResultsList<E>
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

public int getFirstResultPosition()
Specified by:
getFirstResultPosition in interface ResultsList<E>
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

public YahooSearch getYahooSearch()
Specified by:
getYahooSearch in interface ResultsList<E>
Returns:
the YahooSearch that was used to produce this ResultsList. May be null.