001: /*
002: * File : $Source: /usr/local/cvs/opencms/src/org/opencms/search/CmsSearchResultList.java,v $
003: * Date : $Date: 2008-02-27 12:05:38 $
004: * Version: $Revision: 1.8 $
005: *
006: * This library is part of OpenCms -
007: * the Open Source Content Management System
008: *
009: * Copyright (c) 2002 - 2008 Alkacon Software GmbH (http://www.alkacon.com)
010: *
011: * This library is free software; you can redistribute it and/or
012: * modify it under the terms of the GNU Lesser General Public
013: * License as published by the Free Software Foundation; either
014: * version 2.1 of the License, or (at your option) any later version.
015: *
016: * This library is distributed in the hope that it will be useful,
017: * but WITHOUT ANY WARRANTY; without even the implied warranty of
018: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019: * Lesser General Public License for more details.
020: *
021: * For further information about Alkacon Software GmbH, please see the
022: * company website: http://www.alkacon.com
023: *
024: * For further information about OpenCms, please see the
025: * project website: http://www.opencms.org
026: *
027: * You should have received a copy of the GNU Lesser General Public
028: * License along with this library; if not, write to the Free Software
029: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
030: */
031:
032: package org.opencms.search;
033:
034: import java.util.ArrayList;
035: import java.util.Map;
036:
037: /**
038: * A search result object returned as result of a search in
039: * <code>{@link org.opencms.search.CmsSearchIndex}</code>.<p>
040: *
041: * @author Alexander Kandzior
042: *
043: * @version $Revision: 1.8 $
044: *
045: * @since 6.0.0
046: */
047: public class CmsSearchResultList extends ArrayList {
048:
049: /** Serial version UID required for safe serialization. */
050: private static final long serialVersionUID = 606716301025993114L;
051:
052: /** The (otional) categories found in the last the search. */
053: private Map m_categories;
054:
055: /** The total size of all results found in the last search. */
056: private int m_hitCount;
057:
058: /**
059: * Creates a new result list with a default initial capacity of 100.<p>
060: */
061: public CmsSearchResultList() {
062:
063: this (100);
064: }
065:
066: /**
067: * Creates a new result list with the specified initial capacity.<p>
068: *
069: * @param initialCapacity the initial capacity
070: */
071: public CmsSearchResultList(int initialCapacity) {
072:
073: super (initialCapacity);
074: }
075:
076: /**
077: * Returns the (otional) categories found in the last the search, or <code>null</code>
078: * if the category list was not requested in the search.<p>
079: *
080: * @return the (otional) categories found in the last the search
081: *
082: * @see CmsSearch#getCalculateCategories()
083: */
084: public Map getCategories() {
085:
086: return m_categories;
087: }
088:
089: /**
090: * Returns the hit count of all results found in the last search.<p>
091: *
092: * Since this list will only contain the result objects for the current display page,
093: * the size of the list is usually much less then the hit count of all results found.<p>
094: *
095: * @return the hit count of all results found in the last search
096: */
097: public int getHitCount() {
098:
099: return m_hitCount;
100: }
101:
102: /**
103: * Sets the categories found in the last the search.<p>
104: *
105: * @param categories the categories to set
106: *
107: * @see CmsSearch#setCalculateCategories(boolean)
108: */
109: public void setCategories(Map categories) {
110:
111: m_categories = categories;
112: }
113:
114: /**
115: * Sets the hit count of all results found in the last search.<p>
116: *
117: * Since this list will only contain the result objects for the current display page,
118: * the size of the list is usually much less then the hit count of all results found.<p>
119: *
120: * @param hitCount the hit count to set
121: */
122: public void setHitCount(int hitCount) {
123:
124: m_hitCount = hitCount;
125: }
126: }
|