Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/RuntimeCollective/webapps/bean/SearchResult.java


1   /* $Header: /home/CVS/rjp/src/com/RuntimeCollective/webapps/bean/SearchResult.java,v 1.5 2003/09/30 15:13:09 joe Exp $
2    * $Revision: 1.5 $
3    * $Date: 2003/09/30 15:13:09 $
4    *
5    * ====================================================================
6    *
7    * Josephine : http://www.runtime-collective.com/josephine/index.html
8    *
9    * Copyright (C) 2003 Runtime Collective
10   * 
11   * This product includes software developed by the
12   * Apache Software Foundation (http://www.apache.org/).
13   *
14   * This library is free software; you can redistribute it and/or
15   * modify it under the terms of the GNU Lesser General Public
16   * License as published by the Free Software Foundation; either
17   * version 2.1 of the License, or (at your option) any later version.
18   *
19   * This library is distributed in the hope that it will be useful,
20   * but WITHOUT ANY WARRANTY; without even the implied warranty of
21   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22   * Lesser General Public License for more details.
23   *
24   * You should have received a copy of the GNU Lesser General Public
25   * License along with this library; if not, write to the Free Software
26   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27   *
28   */
29  
30  package com.RuntimeCollective.webapps.bean;
31  
32  import com.RuntimeCollective.webapps.SearchResults;
33  import java.io.Serializable;
34  
35  /** A bean containing a single line of a search result.
36   *
37   * @version $Id: SearchResult.java,v 1.5 2003/09/30 15:13:09 joe Exp $
38   */
39  public class SearchResult implements Serializable {
40  
41    // == Constructors ===============================================
42    
43    /** Construct a search result from an id and description. */
44    public SearchResult( int id, String description ) {
45      this.id = id;
46      this.description = description;
47    }
48    
49    /** Construct a search result from an id, description, and set of sub-results. */
50    public SearchResult( int id, String description, SearchResults sub ) {
51      this.id = id;
52      this.description = description;
53      this.sub = sub;
54    }
55    
56    
57    // == Properties =================================================== 
58    
59    /** The unique id for this particular result line. */ 
60    protected int id; 
61    /** Get the unique id for this particular result line. */ 
62    public int getId() { return this.id; } 
63    /** Set the unique id for this particular result line. */ 
64    public void setId(int id) { this.id = id; } 
65    
66    /** The description of this line. */ 
67    protected String description; 
68    /** Get the description of this line. */ 
69    public String getDescription() { return this.description; } 
70    /** Set the description of this line. */ 
71    public void setDescription(String description) { this.description = description; } 
72    
73    /** A set of sub-results for this result. 
74     * For example, a set of `document' search results may include `also see' search results for each entry. 
75     */ 
76    protected SearchResults sub; 
77  
78    /** Get a set of sub-results for this result.
79     * For example, a set of `document' search results may include `also see' search results for each entry. 
80     */ 
81    public SearchResults getSub() { return this.sub; } 
82  
83    /** Set a set of sub-results for this result. 
84     * For example, a set of `document' search results may include `also see' search results for each entry. 
85     */ 
86    public void setSub(SearchResults sub) { this.sub = sub; } 
87    
88    public String toString() {
89      return "ID:" + this.id + " Description : " + this.description + " Sub results : " + ((this.sub != null) ? this.sub.toString() : "null");
90    }
91  }