Rev 5458 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
/*==============================================================================Project: Simple JAVA Search Engine for Keyword SearchJAVA Source file for the class IndexEntryCOPYRIGHT (C), 1998, Thomas Baier* This program is free software; you can redistribute it and/or modify* it under the terms of the GNU General Public License as published by* the Free Software Foundation; either version 2 of the License, or* (at your option) any later version.** This program is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the* GNU General Public License for more details.** You should have received a copy of the GNU General Public License* along with this program; if not, write to the Free Software* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA$Source: /scratch/CVS-ARCHIVE/R/doc/html/search/IndexEntry.java,v $$Revision: 1.3 $$Date: 1999/08/10 09:56:03 $$Author: ripley $==============================================================================*//* -------------------------------- Imports --------------------------------- */import java.lang.Object;import java.lang.String;import java.applet.AppletContext;import java.net.URL;import java.net.MalformedURLException;/*==============================================================================Interface of class IndexEntry==============================================================================*//*------------------------------------------------------------------------------CLASS: IndexEntrySUPER: ObjectCONF. TO:PURPOSE:NOTES:HISTORY: 98-04-26: created------------------------------------------------------------------------------*/public class IndexEntry extends Object{/*============================================================================Public methods============================================================================*//*----------------------------------------------------------------------------INTERFACE:PURPOSE: constructorNOTES:PARAMS:THROWS:RETURNS: voidHISTORY: 98-04-26: created98-05-08: adapted for new index file format98-05-10: added trace----------------------------------------------------------------------------*/public IndexEntry (String title,String keywords,String desc,String url){iTitle = title;iKey = keywords;iDescription = desc;iURL = url;// trace hereTracer.write ("Created IndexEntry. Title = \"" +title + "\", Keywords = \"" + keywords + "\"\n");return;}/*----------------------------------------------------------------------------INTERFACE:PURPOSE: check for a matching search stringNOTES: case-insensitive comparePARAMS:THROWS:RETURNS: boolean: true if matchesHISTORY: 98-04-26: created98-05-15: new parameter mode, check description, too----------------------------------------------------------------------------*/public boolean matches (String aString,int mode){// case-insensitive substring!if ((mode & IndexTable.cSearchDescription) == IndexTable.cSearchDescription) {if ((iKey.toUpperCase ().indexOf (aString.toUpperCase ()) > -1)|| (iDescription.toUpperCase ().indexOf (aString.toUpperCase ()) > -1)) {return true;}} else {if (iKey.toUpperCase ().indexOf (aString.toUpperCase ()) > -1) {return true;}}return false;}/*----------------------------------------------------------------------------INTERFACE:PURPOSE: return the description textNOTES:PARAMS:THROWS:RETURNS: String: the descriptionHISTORY: 98-04-26: created----------------------------------------------------------------------------*/public String getDescription (){return iDescription;}/*----------------------------------------------------------------------------INTERFACE:PURPOSE: return the title stringNOTES:PARAMS:THROWS:RETURNS: voidHISTORY: 98-05-08: created----------------------------------------------------------------------------*/public String getTitle (){return iTitle;}/*----------------------------------------------------------------------------INTERFACE:PURPOSE: return the URL as a stringNOTES:PARAMS:THROWS:RETURNS: String: the URLHISTORY: 98-04-26: created----------------------------------------------------------------------------*/public String getURL (){return iURL;}/*============================================================================Protected methods============================================================================*//*============================================================================Private methods============================================================================*//*============================================================================Instance Variables============================================================================*/private String iTitle;private String iKey;private String iDescription;private String iURL;/*============================================================================Static Data============================================================================*/}/*==============================================================================HISTORY:$Log: IndexEntry.java,v $Revision 1.3 1999/08/10 09:56:03 ripleychange FSF address in copyrightsadd some copyrights in src/gnome and elsewhereRevision 1.2 1999/03/04 17:15:18 leischvarious bugfixesRevision 1.1.4.1 1999/03/02 15:19:55 leischsearch used only kewords, no titlesRevision 1.4 1998/05/15 22:07:56 baieralso allow search in descriptionRevision 1.3 1998/05/10 02:43:24 baiernow a simple data-classRevision 1.2 1998/04/26 22:35:21 baiersome commentsRevision 1.1 1998/04/26 21:43:09 baierInitial revision==============================================================================*/// Local Variables:// mode: Java// mode: font-lock// End: