The R Project SVN R

Rev

Rev 1230 | Rev 5458 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1230 Rev 3765
Line 3... Line 3...
3
  Project: Simple JAVA Search Engine for Keyword Search
3
  Project: Simple JAVA Search Engine for Keyword Search
4
  
4
  
5
  JAVA Source file for the class IndexEntry
5
  JAVA Source file for the class IndexEntry
6
  
6
  
7
  COPYRIGHT (C), 1998, Thomas Baier
7
  COPYRIGHT (C), 1998, Thomas Baier
-
 
8
 
-
 
9
 *  This program is free software; you can redistribute it and/or modify
-
 
10
 *  it under the terms of the GNU General Public License as published by
-
 
11
 *  the Free Software Foundation; either version 2 of the License, or
8
  ALL RIGHTS RESERVED.
12
 *  (at your option) any later version.
-
 
13
 *
-
 
14
 *  This program is distributed in the hope that it will be useful,
-
 
15
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-
 
16
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-
 
17
 *  GNU General Public License for more details.
-
 
18
 *
-
 
19
 *  You should have received a copy of the GNU General Public License
-
 
20
 *  along with this program; if not, write to the Free Software
-
 
21
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
9
  
22
  
10
  $Source: /scratch/CVS-ARCHIVE/R/doc/html/search/IndexEntry.java,v $
23
  $Source: /scratch/CVS-ARCHIVE/R/doc/html/search/IndexEntry.java,v $
11
  
24
  
12
  $Revision: 1.1 $
25
  $Revision: 1.2 $
13
 
26
 
14
  $Date: 1998/05/15 10:38:09 $
27
  $Date: 1999/03/04 17:15:18 $
15
  
28
  
16
  $Author: leisch $
29
  $Author: leisch $
17
 
30
 
18
==============================================================================*/
31
==============================================================================*/
19
 
32
 
Line 84... Line 97...
84
    PARAMS:    
97
    PARAMS:    
85
    THROWS:    
98
    THROWS:    
86
    RETURNS:   boolean: true if matches
99
    RETURNS:   boolean: true if matches
87
  
100
  
88
    HISTORY:   98-04-26: created
101
    HISTORY:   98-04-26: created
-
 
102
               98-05-15: new parameter mode, check description, too
89
  ----------------------------------------------------------------------------*/
103
  ----------------------------------------------------------------------------*/
90
  public boolean matches (String aString)
104
  public boolean matches (String aString,int mode)
91
  {
105
  {
92
    // case-insensitive substring!
106
    // case-insensitive substring!
-
 
107
    if ((mode & IndexTable.cSearchDescription) == IndexTable.cSearchDescription) {
93
    if (iKey.toUpperCase ().indexOf (aString.toUpperCase ()) > -1) {
108
      if ((iKey.toUpperCase ().indexOf (aString.toUpperCase ()) > -1)
-
 
109
	  || (iDescription.toUpperCase ().indexOf (aString.toUpperCase ()) > -1)) {
94
      return true;
110
	return true;
-
 
111
      }
95
    } else {
112
    } else {
-
 
113
      if (iKey.toUpperCase ().indexOf (aString.toUpperCase ()) > -1) {
96
      return false;
114
	return true;
-
 
115
      }
97
    }
116
    }
-
 
117
    return false;
98
  }
118
  }
99
 
119
 
100
 
120
 
101
  /*----------------------------------------------------------------------------
121
  /*----------------------------------------------------------------------------
102
    INTERFACE: 
122
    INTERFACE: 
Line 179... Line 199...
179
/*==============================================================================
199
/*==============================================================================
180
 
200
 
181
  HISTORY:
201
  HISTORY:
182
  
202
  
183
  $Log: IndexEntry.java,v $
203
  $Log: IndexEntry.java,v $
184
  Revision 1.1  1998/05/15 10:38:09  leisch
204
  Revision 1.2  1999/03/04 17:15:18  leisch
185
  New: Search Engine
205
  various bugfixes
-
 
206
 
-
 
207
  Revision 1.1.4.1  1999/03/02 15:19:55  leisch
-
 
208
  search used only kewords, no titles
-
 
209
 
-
 
210
  Revision 1.4  1998/05/15 22:07:56  baier
-
 
211
  also allow search in description
186
 
212
 
187
  Revision 1.3  1998/05/10 02:43:24  baier
213
  Revision 1.3  1998/05/10 02:43:24  baier
188
  now a simple data-class
214
  now a simple data-class
189
 
215
 
190
  Revision 1.2  1998/04/26 22:35:21  baier
216
  Revision 1.2  1998/04/26 22:35:21  baier