All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.protege.editor.owl.rdf.SparqlResultSet Maven / Gradle / Ivy

Go to download

Plug-in for the Protege Desktop ontology editor that provides support for writing and executing SPARQL queries.

The newest version!
package org.protege.editor.owl.rdf;

import java.util.ArrayList;
import java.util.List;

public class SparqlResultSet {
	private List columnNames = new ArrayList();
	private List> entries = new ArrayList>();
	
	public SparqlResultSet(List colunmNames) {
		this.columnNames = new ArrayList(colunmNames);
	}
	
	public void addRow(List row) {
		assert(row.size() == columnNames.size());
		entries.add(row);
	}
	
	public int getColumnCount() {
		return columnNames.size();
	}
	
	public int getRowCount() {
		return entries.size();
	}
	
	public String getColumnName(int col) {
		return columnNames.get(col);
	}
	
	public Object getResult(int row, int col) {
		return entries.get(row).get(col);
	}
	
	
}