org.z3950.zoom
Class ResultSet

java.lang.Object
  |
  +--org.z3950.zoom.ResultSet

public class ResultSet
extends java.lang.Object

Represents a result set held on a Z39.50 Server, as described in the ZOOM Abstract API.

Synopsis:

	ResultSet rs = conn.search(query);
	int size = rs.size();
	for (int i = 0; i < size; i++) {
	    System.out.println(rs.getRecord(i).render());
	}
 

ResultSets are created only by the Connection class's search() method, so there is no public constructor for this class.

Version:
$Id: ResultSet.java,v 1.6 2002/12/14 00:17:49 mike Exp $
See Also:
Connection.search(Query), zoom.z3950.org/api/zoom-1.1.html#3.4

Method Summary
 void delete()
          Deletes this ResultSet, informing the server that it may release any resources it has allocated to it.
 Record getRecord(int i)
          Fetches the ith record of this ResultSet from the server on the other end of the Connection with which the ResultSet was created.
 java.lang.String option(java.lang.String key)
          Returns the value of the specified option in this ResultSet object, if it is defined there; otherwise returns the specified option's value in the Connection object by which this ResultSet was created.
 java.lang.String option(java.lang.String key, java.lang.String val)
          Sets the specified option in this ResultSet object to the specified value, returning its previous value (as would have been returned by the single-parameter version.)
 int size()
          Returns the number of records found by the server satisfying the query with which this ResultSet was created.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

option

public java.lang.String option(java.lang.String key)
Returns the value of the specified option in this ResultSet object, if it is defined there; otherwise returns the specified option's value in the Connection object by which this ResultSet was created.
Parameters:
key - the name of the requested option
Returns:
the value of the specified option, or null if no such option has been defined.
See Also:
Connection.option(String), zoom.z3950.org/api/zoom-1.1.html#3.4.2

option

public java.lang.String option(java.lang.String key,
                               java.lang.String val)
Sets the specified option in this ResultSet object to the specified value, returning its previous value (as would have been returned by the single-parameter version.)
Parameters:
key - the name of the option to set
value - the value to which to set the specified option
Returns:
the old value of the specified option, if any
See Also:
option(String), zoom.z3950.org/api/zoom-1.1.html#3.4.2

size

public int size()
Returns the number of records found by the server satisfying the query with which this ResultSet was created.
Returns:
the number of records in the ResultSet
See Also:
zoom.z3950.org/api/zoom-1.1.html#3.4.3

getRecord

public Record getRecord(int i)
Fetches the ith record of this ResultSet from the server on the other end of the Connection with which the ResultSet was created. Counting starts from zero, so that the highest acceptable value of i is one less than the return value of the size() method.
Parameters:
i - zero-based index of the record to fetch.
Returns:
a newly created Record object representing the data held on the server.
See Also:
zoom.z3950.org/api/zoom-1.1.html#3.4.4

delete

public void delete()
Deletes this ResultSet, informing the server that it may release any resources it has allocated to it.
See Also:
zoom.z3950.org/api/zoom-1.1.html#3.4.5