RDMResultSet.java :  » Portal » Open-Portal » com » sun » portal » search » db » Java Open Source

Java Open Source » Portal » Open Portal 
Open Portal » com » sun » portal » search » db » RDMResultSet.java
/*
 * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
 * PROPRIETARY/CONFIDENTIAL.  Use of this product is subject to license terms.
 */

package com.sun.portal.search.db;

import com.sun.portal.search.rdm.*;
import com.sun.portal.search.soif.*;

import java.util.*;


/**
 *
 * RDM Server search result set implementation
 *
 */
abstract public class RDMResultSet {
    
  /** Creates a new instance of RDMResultSet */
  public RDMResultSet(SToken st, RDMDb database, String query, RDMTransaction t) {
    this.st = st;
    this.database = database;
    this.query = query;
    this.txn = t;
  }

    
  /**
   * Get an instance of RDMDb
   * @return RDMDb
   */
  public RDMDb getDb() {
    return database;
  }
    
    
  /**
   * Retrieve a search result
   * @param i Document index
   * @return a SOIF hit
   */
  public SOIF getResult(int i) {
    return getResult(i, null, null);
  }


  /**
   * Retrieve Search Results
   * @param i Document index
   * @param view Attributes
   * @param hltags Highlight tags
   * @return a SOIF hit, filtered by view and highlighted with the given highlight tags
   */
  public abstract SOIF getResult(int i, Set view, String[] highlightTags);

    
  /**
   * Get search result count
   * @return current number of hits in this set 
   */
  public abstract int getResultCount();
    
    
  /**
   * Get hit count
   * @return total number of hits for this search
   */
  public abstract long getHitCount();
    
    
  /**
   * Get document count
   * @return number of docs searched
   */
  public abstract long getDocCount();
    
    
  /**
   * Get the search token
   * @return the result set stoken
   */
  public SToken getSToken() {
    return st;
  }
    
    
  /**
   * Get the handle to the RDMTransaction
   * @return the result set transaction
   */
  public RDMTransaction getTransaction() {
    return txn;
  }
    
    
  /**
   * Transform the result set to string
   * @return string representation of this result set
   */
  public java.lang.String toString() {
    return "Search Result Set...";
  }
    
  protected SToken st;
  protected String query;
  protected RDMDb database;
  protected RDMTransaction txn;
  protected RDMResultSet() {}    

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.