001: /*
002: * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
003: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
004: */
005:
006: package com.sun.portal.search.db;
007:
008: import com.sun.portal.search.rdm.*;
009: import com.sun.portal.search.soif.*;
010:
011: import java.util.*;
012:
013: /**
014: *
015: * RDM Server search result set implementation
016: *
017: */
018: abstract public class RDMResultSet {
019:
020: /** Creates a new instance of RDMResultSet */
021: public RDMResultSet(SToken st, RDMDb database, String query,
022: RDMTransaction t) {
023: this .st = st;
024: this .database = database;
025: this .query = query;
026: this .txn = t;
027: }
028:
029: /**
030: * Get an instance of RDMDb
031: * @return RDMDb
032: */
033: public RDMDb getDb() {
034: return database;
035: }
036:
037: /**
038: * Retrieve a search result
039: * @param i Document index
040: * @return a SOIF hit
041: */
042: public SOIF getResult(int i) {
043: return getResult(i, null, null);
044: }
045:
046: /**
047: * Retrieve Search Results
048: * @param i Document index
049: * @param view Attributes
050: * @param hltags Highlight tags
051: * @return a SOIF hit, filtered by view and highlighted with the given highlight tags
052: */
053: public abstract SOIF getResult(int i, Set view,
054: String[] highlightTags);
055:
056: /**
057: * Get search result count
058: * @return current number of hits in this set
059: */
060: public abstract int getResultCount();
061:
062: /**
063: * Get hit count
064: * @return total number of hits for this search
065: */
066: public abstract long getHitCount();
067:
068: /**
069: * Get document count
070: * @return number of docs searched
071: */
072: public abstract long getDocCount();
073:
074: /**
075: * Get the search token
076: * @return the result set stoken
077: */
078: public SToken getSToken() {
079: return st;
080: }
081:
082: /**
083: * Get the handle to the RDMTransaction
084: * @return the result set transaction
085: */
086: public RDMTransaction getTransaction() {
087: return txn;
088: }
089:
090: /**
091: * Transform the result set to string
092: * @return string representation of this result set
093: */
094: public java.lang.String toString() {
095: return "Search Result Set...";
096: }
097:
098: protected SToken st;
099: protected String query;
100: protected RDMDb database;
101: protected RDMTransaction txn;
102:
103: protected RDMResultSet() {
104: }
105:
106: }
|