org.apache.manifoldcf.core.database
Class MergedResultSet

java.lang.Object
  extended by org.apache.manifoldcf.core.database.MergedResultSet
All Implemented Interfaces:
IResultSet

public class MergedResultSet
extends java.lang.Object
implements IResultSet

This class merges several resultsets together to make what appears to be a single one. This is very useful when queries are broken up due to restrictions in the length of an IN clause, but the results may need to be merged at the end.


Field Summary
static java.lang.String _rcsid
           
protected  java.util.ArrayList resultSets
           
protected  int totalRowCount
           
 
Constructor Summary
MergedResultSet()
           
 
Method Summary
 void addResultSet(IResultSet set)
           
 IResultRow getRow(int rowNumber)
          Get a specific row in the resultset.
 int getRowCount()
          Get the number of rows in this resultset.
 IResultRow[] getRows()
          Get an array of all the rows.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_rcsid

public static final java.lang.String _rcsid
See Also:
Constant Field Values

resultSets

protected java.util.ArrayList resultSets

totalRowCount

protected int totalRowCount
Constructor Detail

MergedResultSet

public MergedResultSet()
Method Detail

addResultSet

public void addResultSet(IResultSet set)

getRow

public IResultRow getRow(int rowNumber)
Get a specific row in the resultset.

Specified by:
getRow in interface IResultSet
Parameters:
rowNumber - is the number of the row.
Returns:
the immutable row description, or null if there is no such row.

getRowCount

public int getRowCount()
Get the number of rows in this resultset.

Specified by:
getRowCount in interface IResultSet
Returns:
the number of rows the resultset contains.

getRows

public IResultRow[] getRows()
Get an array of all the rows. This method is NOT preferred because it requires a new array object to be constructed.

Specified by:
getRows in interface IResultSet
Returns:
the array.