From graffito-commits-return-213-apmail-incubator-graffito-commits-archive=www.apache.org@incubator.apache.org Thu Jul 28 05:29:53 2005 Return-Path: Delivered-To: apmail-incubator-graffito-commits-archive@www.apache.org Received: (qmail 77101 invoked from network); 28 Jul 2005 05:29:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Jul 2005 05:29:53 -0000 Received: (qmail 89185 invoked by uid 500); 28 Jul 2005 05:29:52 -0000 Mailing-List: contact graffito-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: graffito-dev@incubator.apache.org Delivered-To: mailing list graffito-commits@incubator.apache.org Received: (qmail 89168 invoked by uid 500); 28 Jul 2005 05:29:52 -0000 Delivered-To: apmail-incubator-graffito-cvs@incubator.apache.org Received: (qmail 89165 invoked by uid 99); 28 Jul 2005 05:29:52 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 27 Jul 2005 22:29:20 -0700 Received: (qmail 77009 invoked by uid 65534); 28 Jul 2005 05:29:18 -0000 Message-ID: <20050728052918.77007.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r225687 [2/2] - in /incubator/graffito/trunk/api/src/java/org/apache/portals/graffito: ./ context/ model/ model/core/ model/dm/ model/permission/ model/server/ search/ services/ services/core/ services/dm/ services/search/ Date: Thu, 28 Jul 2005 05:29:13 -0000 To: graffito-cvs@incubator.apache.org From: clombart@apache.org X-Mailer: svnmailer-1.0.2 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/search/SearchResults.java URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/search/SearchResults.java?rev=225687&view=auto ============================================================================== --- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/search/SearchResults.java (added) +++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/search/SearchResults.java Wed Jul 27 22:28:56 2005 @@ -0,0 +1,123 @@ +/* + * Copyright 2004-2005 The Apache Software Foundation or its licensors, + * as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.portals.graffito.services.search; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.apache.portals.graffito.model.core.CmsObject; + + +/** + * Container for search result entries + * + * @author David Sean taylor + * @version $Id: SearchResults.java,v 1.1 2004/12/22 21:16:12 christophe Exp $ + */ +public class SearchResults +{ + private List results = null; + + /** + */ + public SearchResults() + { + init(0); + } + + /** + * + * @param initialCapacity + */ + public SearchResults(int initialCapacity) + { + init(initialCapacity); + } + + /** + * + * @param initialCapacity + */ + private void init(int initialCapacity) + { + results = new ArrayList(initialCapacity); + } + + /** + * + * @param searchResult + * @return + */ + public boolean add(CmsObject cmsObject) + { + return results.add(cmsObject); + } + + /** + * + * @param index + * @param searchResult + */ + public void add(int index, CmsObject cmsObject) + { + results.add(index, cmsObject); + return; + } + + /** + * + * @param index + * @param searchResult + */ + public void addAll(Collection cmsObjects) + { + results.addAll(cmsObjects); + return; + } + + + /** + * + * @param index + * @return + */ + public CmsObject get(int index) + { + return(CmsObject) results.get(index); + } + + /** + * + * @return + */ + public int size() + { + return results.size(); + } + + /** + * + * @return + */ + public List getResults() + { + return this.results; + } + +}