org.openrdf.sesame.query
Class QueryResultsTable

java.lang.Object
  extended byorg.openrdf.sesame.query.QueryResultsTable
All Implemented Interfaces:
Serializable

public class QueryResultsTable
extends Object
implements Serializable

A table for query results. This table is provided for those who do not want to use the streaming approach provided by the QueryResultListener. The QueryResultsTableBuilder can be used to build the tables. The query results table is guaranteed to be rectangular (i.e. the number of columns is equal for all rows).

See Also:
TableQueryResultListener, QueryResultsTableBuilder, Serialized Form

Constructor Summary
QueryResultsTable(int colCount)
          Creates a new QueryResultsTable that can store a query result with the indicated number of columns.
QueryResultsTable(int colCount, String[] columnNames)
           
 
Method Summary
 boolean equals(Object other)
          Compares this QueryResultsTable with another, returning true if both contain the same values.
 int getColumnCount()
          Gets the number of columns in this table.
 String getColumnName(int column)
          Return the name of the column at index 'column'
 String[] getColumnNames()
          return the names of all columns in an array.
 int getRowCount()
          Gets the number of rows in this table.
 Value getValue(int row, int column)
          Fetches the value at the specified row and column in this table.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryResultsTable

public QueryResultsTable(int colCount)
Creates a new QueryResultsTable that can store a query result with the indicated number of columns.

Parameters:
colCount - The number of columns that the query result has.

QueryResultsTable

public QueryResultsTable(int colCount,
                         String[] columnNames)
Method Detail

getRowCount

public int getRowCount()
Gets the number of rows in this table.


getColumnCount

public int getColumnCount()
Gets the number of columns in this table.


getColumnNames

public String[] getColumnNames()
return the names of all columns in an array.

Returns:
an array containing the names of all columns, or null if not known.

getColumnName

public String getColumnName(int column)
Return the name of the column at index 'column'

Parameters:
column - the column index
Returns:
the name of the column, or null if not known.

getValue

public Value getValue(int row,
                      int column)
Fetches the value at the specified row and column in this table. Both row and column are 0-based.

Throws:
IndexOutOfBoundsException - If the requested row or column is out of the range of this table.

equals

public boolean equals(Object other)
Compares this QueryResultsTable with another, returning true if both contain the same values. The column names do not necessarily need to be identical for the tables to be considered equal.


hashCode

public int hashCode()

toString

public String toString()


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.