at.spardat.xma.datasource.ITabularData Maven / Gradle / Ivy
The newest version!
/*******************************************************************************
* Copyright (c) 2003, 2007 s IT Solutions AT Spardat GmbH .
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* s IT Solutions AT Spardat GmbH - initial API and implementation
*******************************************************************************/
// @(#) $Id: ITabularData.java 2089 2007-11-28 13:56:13Z s3460 $
package at.spardat.xma.datasource;
import at.spardat.xma.mdl.Atom;
/**
* Represents a table consisting of {@link at.spardat.xma.mdl.Atom Atoms} provided by
* a ITabularDataSource.
*
* @author YSD, 17.04.2003 23:12:34
*/
public interface ITabularData {
/**
* Returns the number of rows in this table
*/
public int size ();
/**
* Returns the number of columns in this table
*/
public int numCols ();
/**
* Returns the value of a particular table cell
*
* @param row the zero based row index. Must be less than size() and greater equal zero.
* @param col the zero based column index. Must be less than numCols() and greater equal zero.
* @return non null Atom.
* @exception IllegalArgumentException if row or col is
* out of bounds.
*/
public Atom getCell (int row, int col);
/**
* Returns the value of a particular table cell
*
* @param row the zero based row index. Must be less than size() and greater equal zero
* @param columnName
* @return non null Atom.
* @exception IllegalArgumentException if row is out of bounds or columnName
* does not exist.
*/
public Atom getCell (int row, String columnName);
/**
* Returns the column index in the table of the column with the given header name
*
* @param colName the column name
* @return zero based index of the column or -1 if there is no column with name colName.
*/
public int getColumnIndex (String colName);
/**
* Returns the header name of the n'th column in the table
*
* @param col the column index
* @exception IllegalArgumentException if col greater equal to numCols().
*/
public String getColumnName (int col);
}