org.opencms.search.galleries
Class CmsGallerySearchResultList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<CmsGallerySearchResult>
              extended by org.opencms.search.galleries.CmsGallerySearchResultList
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<CmsGallerySearchResult>, java.util.Collection<CmsGallerySearchResult>, java.util.List<CmsGallerySearchResult>, java.util.RandomAccess

public class CmsGallerySearchResultList
extends java.util.ArrayList<CmsGallerySearchResult>

The search result list for the gallery search index.

Since:
8.0.0
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
CmsGallerySearchResultList()
          Creates a new result list with a default initial capacity of 100.
CmsGallerySearchResultList(int initialCapacity)
          Creates a new result list with the specified initial capacity.
 
Method Summary
 void append(CmsGallerySearchResultList moreResults)
          Appends the results from another search result list.
protected  void calculatePages(int pageIndex, int matchesPerPage)
          Calculates the result pages.
 int getHitCount()
          Returns the hit count of all results found in the last search.
 int getPageCount()
          Returns the total number of search result pages.
 int getResultPage()
          Returns the index of the current result page.
 void setHitCount(int hitCount)
          Sets the hit count of all results found in the last search.
 
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
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

CmsGallerySearchResultList

public CmsGallerySearchResultList()
Creates a new result list with a default initial capacity of 100.


CmsGallerySearchResultList

public CmsGallerySearchResultList(int initialCapacity)
Creates a new result list with the specified initial capacity.

Parameters:
initialCapacity - the initial capacity
Method Detail

append

public void append(CmsGallerySearchResultList moreResults)
Appends the results from another search result list.

Parameters:
moreResults - the second search result list

getHitCount

public int getHitCount()
Returns the hit count of all results found in the last search.

Since this list will only contain the result objects for the current display page, the size of the list is usually much less then the hit count of all results found.

Returns:
the hit count of all results found in the last search

getPageCount

public int getPageCount()
Returns the total number of search result pages.

Returns:
the total number of search result pages
See Also:
getHitCount(), getResultPage()

getResultPage

public int getResultPage()
Returns the index of the current result page.

Returns:
the index of the current result page
See Also:
getHitCount(), getPageCount()

setHitCount

public void setHitCount(int hitCount)
Sets the hit count of all results found in the last search.

Since this list will only contain the result objects for the current display page, the size of the list is usually much less then the hit count of all results found.

Parameters:
hitCount - the hit count to set

calculatePages

protected void calculatePages(int pageIndex,
                              int matchesPerPage)
Calculates the result pages.

Parameters:
pageIndex - the index of the current page
matchesPerPage - the matches per page