incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
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 GMT
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 <a href="mailto:taylor@apache.org">David Sean taylor</a>
+ * @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;
+    }
+    
+}



Mime
View raw message