Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: joist/java/org/joist/search SearchResult.java

Project highlights: Architectural Overview

joist
Discussion topic

Hide all messages in topic

All messages in topic

CVS update: joist/java/org/joist/search SearchResult.java

Author stack
Full name Michael Stack
Date 2000-10-24 11:33:16 PDT
Message User: stack
  Date: 00/10/24 11:33:16

  Modified: java/org/joist/search SearchResult.java
  Log:
  Added conveniance methods to make the handling of the URL search item easier in WebMacro. Fixed bug in the object.toString( )
  
  Revision Changes Path
  1.2 +34 -27 joist/java/org/joist​/search/SearchResult​.java
  
  Index: SearchResult.java
  ====================​====================​====================​=======
  RCS file: /cvs/joist/java/org/​joist/search/SearchR​esult.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SearchResult.java 2000/10/23 23:21:45 1.1
  +++ SearchResult.java 2000/10/24 18:33:16 1.2
  @@ -56,14 +56,14 @@
   * etc., as well as a SearchResultItem per result returned.
   *
   * @author <a href="mailto:stack@c​ollab.net">St.Ack​</a>
  -* @version $Id: SearchResult.java,v 1.1 2000/10/23 23:21:45 stack Exp $
  +* @version $Id: SearchResult.java,v 1.2 2000/10/24 18:33:16 stack Exp $
   */
   public class SearchResult
   {
       /** Class version string
       */
       public static final String versionID
  - = "$Id: SearchResult.java,v 1.1 2000/10/23 23:21:45 stack Exp $";
  + = "$Id: SearchResult.java,v 1.2 2000/10/24 18:33:16 stack Exp $";
       
       
       /** Array of search results.
  @@ -187,7 +187,7 @@
       * and two files. Returned as part of every search.
       * @return A description string
       */
  - protected String getIndexStats( )
  + public String getIndexStats( )
       {
           return indexStats;
       }
  @@ -276,51 +276,58 @@
       {
           StringBuffer strBuffer = new StringBuffer( );
           strBuffer.append( super.toString( ) );
  - strBuffer.append( ": indexName <" );
  + strBuffer.append( ": indexName " );
           strBuffer.append( ( getIndexName( ) != null )
                               ? getIndexName( )
                               : "null" );
  - strBuffer.append( ">, numberOfHits <" );
  + strBuffer.append( ", numberOfHits " );
           strBuffer.append( Integer.toString( getNumberOfHits( ) ) );
  - strBuffer.append( ">, indexModDate <" );
  + strBuffer.append( ", indexModDate " );
           strBuffer.append( ( getIndexModDate( ) != null )
                               ? getIndexModDate( )
                               : "null" );
  - strBuffer.append( ">, indexStats <" );
  + strBuffer.append( ", indexStats " );
           strBuffer.append( ( getIndexStats( ) != null )
                               ? getIndexStats( )
                               : "null" );
  - strBuffer.append( ">, searchengineSearchWords <" );
  + strBuffer.append( ", searchengineSearchWords " );
           strBuffer.append( ( getSearchengineSearchWords( ) != null )
                               ? getSearchengineSearchWords( )
                               : "null" );
  - strBuffer.append( ">, indexPointer <" );
  + strBuffer.append( ", indexPointer " );
           strBuffer.append( ( getIndexPointer( ) != null )
                               ? getIndexPointer( )
                               : "null" );
  - strBuffer.append( ">, description <" );
  + strBuffer.append( ", description " );
           strBuffer.append( ( getDescription( ) != null )
                               ? getDescription( )
  - : "null" );
  - strBuffer.append( ">\n" );
  + : "null" );
  + strBuffer.append( "\n" );
  +
           
  + // Now do each of the result items, a line to themselves
  + //
           SearchResultItem item = null;
  - for( int i = 0; i < resultItems.size( ); i++ )
  + label_searchresults_not_null: if( resultItems != null )
           {
  - item = ( SearchResultItem )resultItems.get( i );
  - strBuffer.append( Integer.toString( i ) );
  - strBuffer.append( ": ranking <" );
  - strBuffer.append( Integer.toString( item.getRanking( ) ) );
  - strBuffer.append( ">, size <" );
  - strBuffer.append( Integer.toString( item.getSize( ) ) );
  - strBuffer.append( ">, url <" );
  - strBuffer.append( item.getLocation( ).toString( ) );
  - strBuffer.append( ">, title <" );
  - strBuffer.append( ( item.getTitle( ) != null )
  - ? item.getTitle( )
  - : "null" );
  - strBuffer.append( ">\n" );
  - }
  + for( int i = 0; i < resultItems.size( ); i++ )
  + {
  + item = ( SearchResultItem )resultItems.get( i );
  + strBuffer.append( Integer.toString( i ) );
  + strBuffer.append( ": ranking " );
  + strBuffer.append( Integer.toString( item.getRanking( ) ) );
  + strBuffer.append( ", size " );
  + strBuffer.append( Integer.toString( item.getSize( ) ) );
  + strBuffer.append( ", url " );
  + strBuffer.append( item.getUrl( ).toString( ) );
  + strBuffer.append( ", title " );
  + strBuffer.append( ( item.getTitle( ) != null )
  + ? item.getTitle( )
  + : "null" );
  + strBuffer.append( "\n\t" );
  + }
  + } // label_searchresults_not_null
  +
           return strBuffer.toString( );
       }
   }
Messages per page: