Ignore:
Timestamp:
2001-03-05T08:44:51+13:00 (23 years ago)
Author:
bas6
Message:

Documenting NzdlQuery, NzdlResponse, NzdlResultSet & NzdlServiceServer (removed some extraneous @see comments)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/java-client/org/nzdl/gsdl/service/NzdlResultSet.java

    r2098 r2108  
    1 
     1/*
     2 *    NzdlResultSet.java
     3 *    Copyright (C) 2001 New Zealand Digital Library Project
     4 *
     5 *    This program is free software; you can redistribute it and/or modify
     6 *    it under the terms of the GNU General Public License as published by
     7 *    the Free Software Foundation; either version 2 of the License, or
     8 *    (at your option) any later version.
     9 *
     10 *    This program is distributed in the hope that it will be useful,
     11 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
     12 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13 *    GNU General Public License for more details.
     14 *
     15 *    You should have received a copy of the GNU General Public License
     16 *    along with this program; if not, write to the Free Software
     17 *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     18 */
     19
     20//the package we're in
    221package org.nzdl.gsdl.service;
    322
    423import java.util.*;
    524
     25/**
     26 * An object that holds results extracted from a response by
     27 * {@link NzdlResponse#getResultSet() NzdlResponse.getResultSet()}.
     28 * Easily interrogated by a user.
     29 */
    630public class NzdlResultSet extends java.lang.Object {
    731
     
    1135  private List m_queryTerms  = null;
    1236  private List m_docIDs = null;
    13   /** the key is the query term, the value its frequency */
     37
     38  /* The key is the query term, the value its frequency */
    1439  private Map m_frequencies = null;
    15   /**
    16    * the key is the docID, the value is the doc corresponding
     40
     41  /*
     42   * The key is the docID, the value is the doc corresponding
    1743   * meta data which is also a Map where the key is the meta tag
    1844   * and the value is a set of values for that tag
     
    2046  private Map m_docToMetaDataMap = null;
    2147
    22   /** */
    23  
     48  /**
     49   * Creates an empty instance of NzdlResultSet.
     50   */
    2451  public NzdlResultSet() {
    2552    m_resultSet = new ArrayList();
     
    2855  }
    2956
    30   /** */
    31 
     57  /**
     58   * Adds a {@link NzdlQueryHit NzdlQueryHit} to a result set.
     59   * @param hit - is an instance of NzdlQueryHit.
     60   */
    3261  public void add( NzdlQueryHit _hit ) {
    3362    m_resultSet.add( _hit ) ;
     
    3766  }
    3867
     68    /**
     69   * Sets the number of documents in a NzdlResultSet.
     70   * @param num the number of documents in the result set
     71   */
    3972  public void setNumOfDocs( int _num ) {
    4073    m_numDocs = _num;
    4174  }
    4275
     76
     77  /**
     78   * Sets the result type.
     79   * @param type an integer representing the result type.
     80   */
    4381  public void setResultType( int _type ) {
    4482    m_resultType = _type;
    4583  }
    4684
     85  /**
     86   * Sets the Query terms of a NzdlResultSet.
     87   * @param terms a list of words within the query string.
     88   */
    4789  public void setQueryTerms( List _terms ) {
    4890    m_queryTerms = _terms;
     
    5395//    }
    5496
     97  /**
     98   * Sets the term frequencies within a NzdlResultSet.
     99   * @param freqs a map of the term frequencies. The map key is the query term.
     100   */
    55101  public void setTermFrequencies( Map _freqs ) {
    56102    m_frequencies = _freqs;
    57103  }
    58104
    59   /** */
    60 
     105  /**
     106   * Returns the number of documents that matched a query. <br>
     107   * Pre: A {@link NzdlResponse NzdlResponse} object has been created. A
     108   * {@link NzdlService NzdlService} object has filled the NzdlResponse
     109   * object with results from servicing a {@link NzdlRequest NzdlRequest}.<br>
     110   * @return The number of documents that matched a query. This is limited
     111   * by the maxDocs set in {@link NzdlQuery NzdlQuery}
     112   */
    61113  public int getNumOfDocs() {
    62114    return m_numDocs;
    63115  }
    64116
     117  /**
     118   * Returns the result type for the NzdlResultSet. <br>
     119   * Pre: A {@link NzdlResponse NzdlResponse} object has been created. A
     120   * {@link NzdlService NzdlService} object has filled the NzdlResponse
     121   * object with results from servicing a {@link NzdlRequest NzdlRequest}.<br>
     122   * @return result type as an integer.
     123   */
    65124  public int getResultType() {
    66125    return m_resultType;
    67126  }
    68127
     128  /**
     129   * Returns a list of the words within the query string. <br>
     130   * Pre: A {@link NzdlResponse NzdlResponse} object has been created. A
     131   * {@link NzdlService NzdlService} object has filled the NzdlResponse
     132   * object with results from servicing a {@link NzdlRequest NzdlRequest}.<br>
     133   * @return A list of words within the query string.
     134   */
    69135  public List getQueryTerms() {
    70136    return m_queryTerms;
    71137  }
    72  
     138
     139   /**
     140   * Returns the number of hits for each word within the query string. <br>
     141   * Pre: A {@link NzdlResponse NzdlResponse} object has been created. A
     142   * {@link NzdlService NzdlService} object has filled the NzdlResponse
     143   * object with results from servicing a {@link NzdlRequest NzdlRequest}.<br>
     144   * @return A map of the frequency of each query word. The map key is the query term..
     145   */
    73146  public Map getTermFrequencies() {
    74147    return m_frequencies;
     
    90163//    }
    91164
     165  /**
     166   * Returns a list of Document ID's in the NzdlResultSet. <br>
     167   * Pre: A {@link NzdlResponse NzdlResponse} object has been created. A
     168   * {@link NzdlService NzdlService} object has filled the NzdlResponse
     169   * object with results from servicing a {@link NzdlRequest NzdlRequest}.<br>
     170   * @return A list of Document ID's in the NzdlResultSet.
     171   */
    92172    public List getDocumentIDs() {
    93173      return m_docIDs;
     
    105185//    }
    106186
     187  /**
     188   * Returns metatag values for a document. <br>
     189   * Pre: A {@link NzdlResponse NzdlResponse} object has been created. A
     190   * {@link NzdlService NzdlService} object has filled the NzdlResponse
     191   * object with results from servicing a {@link NzdlRequest NzdlRequest}.<br>
     192   * @return A map of metatag values in the specified document. The key
     193   * of the map is the metatag field such as Author or Title.
     194   */
    107195  public Set getMetaData( String _docID, String _metaTag ) {
    108196    Map metaData = (Map) m_docToMetaDataMap.get( _docID );
     
    110198  }
    111199
     200  /**
     201   * Returns all values for a particular metatag in the result set. <br>
     202   * Pre: A {@link NzdlResponse NzdlResponse} object has been created. A
     203   * {@link NzdlService NzdlService} object has filled the NzdlResponse
     204   * object with results from servicing a {@link NzdlRequest NzdlRequest}.<br>
     205   * @param metaTag Descriptive data such as Author, Title or Date.
     206   * @return A map of all values for a particular metatag in all documents
     207   * in the NzdlResultSet. The map key is document ID.
     208   */
    112209  public Map getMetaData( String _metaTag ) {
    113210    Map metaData = new HashMap();
     
    119216  }
    120217
     218  /**
     219   * Returns all values for all metatags in the result set. <br>
     220   * Pre: A {@link NzdlResponse NzdlResponse} object has been created. A
     221   * {@link NzdlService NzdlService} object has filled the NzdlResponse
     222   * object with results from servicing a {@link NzdlRequest NzdlRequest}.<br>
     223   * @return The metatag values for all metatags in all documents
     224   * in the NzdlResultSet. The map key is document ID.
     225   */
    121226  public Map getAllMetaData( ) {
    122227    return m_docToMetaDataMap;
Note: See TracChangeset for help on using the changeset viewer.