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

Quick Search    Search Deep

Source code: org/nzdl/gsdl/Phind/ResultItemDocument.java


1   /**********************************************************************
2    *
3    * ResultItemDocument.java -- a document result in the Phind applet
4    *
5    * Copyright 1997-2000 Gordon W. Paynter
6    * Copyright 2000 The New Zealand Digital Library Project
7    *
8    * A component of the Greenstone digital library software
9    * from the New Zealand Digital Library Project at the
10   * University of Waikato, New Zealand.
11   *
12   * This program is free software; you can redistribute it and/or modify
13   * it under the terms of the GNU General Public License as published by
14   * the Free Software Foundation; either version 2 of the License, or
15   * (at your option) any later version.
16   *
17   * This program is distributed in the hope that it will be useful,
18   * but WITHOUT ANY WARRANTY; without even the implied warranty of
19   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20   * GNU General Public License for more details.
21   *
22   * You should have received a copy of the GNU General Public License
23   * along with this program; if not, write to the Free Software
24   * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25   *
26   *********************************************************************/
27  
28  /*********************************************************************
29  
30  This class is used in the Phind java applet (Phind.java).
31  
32  It contains information describing a document in which a search term 
33  occurs.
34  
35  **********************************************************************/
36  
37  package org.nzdl.gsdl.Phind;
38  
39  public class ResultItemDocument extends ResultItem {
40  
41      // The document's title is stored in the superclasses 
42      // text variable, and the number of times the phrase occurs
43      // in the frequency variable. 
44  
45      // The document's unique object identifier (hash value).
46      String hash;
47  
48      // Create a ResultItem for a document
49      ResultItemDocument(String newHash, String newTitle, String newFrequency) {
50    
51    kind = documentItem;
52    text = newTitle;
53  
54    sort = sortDocumentItem;
55    frequency = Integer.valueOf(newFrequency).intValue();
56    hash = newHash;
57      }
58  
59      // Is this item a document?
60      public boolean isDocument() { return true; }
61  
62      // Return the bare text of the item
63      public String toString() { return(text); }
64  
65      // Return the text of the item components
66      public String hiddenText() { return hash; }
67   
68  
69  }
70