org.opencms.search.CmsSearchResultList Maven / Gradle / Ivy
Show all versions of opencms-test Show documentation
/*
* This library is part of OpenCms -
* the Open Source Content Management System
*
* Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* For further information about Alkacon Software GmbH & Co. KG, please see the
* company website: http://www.alkacon.com
*
* For further information about OpenCms, please see the
* project website: http://www.opencms.org
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.opencms.search;
import java.util.ArrayList;
import java.util.Map;
/**
* A search result object returned as result of a search in
* {@link org.opencms.search.CmsSearchIndex}
.
*
* @since 6.0.0
*/
public class CmsSearchResultList extends ArrayList {
/** Serial version UID required for safe serialization. */
private static final long serialVersionUID = 606716301025993114L;
/** The (optional) categories found in the last the search. */
private Map m_categories;
/** The total size of all results found in the last search. */
private int m_hitCount;
/**
* Creates a new result list with a default initial capacity of 100.
*/
public CmsSearchResultList() {
this(100);
}
/**
* Creates a new result list with the specified initial capacity.
*
* @param initialCapacity the initial capacity
*/
public CmsSearchResultList(int initialCapacity) {
super(initialCapacity);
}
/**
* Returns the (otional) categories found in the last the search, or null
* if the category list was not requested in the search.
*
* @return the (otional) categories found in the last the search
*
* @see CmsSearch#getCalculateCategories()
*/
public Map getCategories() {
return m_categories;
}
/**
* 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.
*
* @return the hit count of all results found in the last search
*/
public int getHitCount() {
return m_hitCount;
}
/**
* Sets the categories found in the last the search.
*
* @param categories the categories to set
*
* @see CmsSearch#setCalculateCategories(boolean)
*/
public void setCategories(Map categories) {
m_categories = categories;
}
/**
* 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.
*
* @param hitCount the hit count to set
*/
public void setHitCount(int hitCount) {
m_hitCount = hitCount;
}
}