com.sas.table
Class StaticTableInterfaceSupport

com.sas.table.StaticTableInterfaceSupport

public abstract class StaticTableInterfaceSupport

Helper class for implementations of StaticTableInterface, StaticColumnLabelInterface, and StaticRowLabelInterface.

See Also:
StaticTableInterface, StaticColumnLabelInterface, StaticRowLabelInterface

Constructor Summary
StaticTableInterfaceSupport()
           
 
Method Summary
static int countColumns(StaticTableInterface table, int maxCount)
          Use when your implementation of getColumnCount() does not return -1.
static int countRows(StaticTableInterface table, int maxCount)
          Use when your implementation of getRowCount() does not return -1.
static java.lang.Class[][] getCellClasses(StaticTableInterface table, int startRowIndex, int startColumnIndex, int rowCount, int columnCount)
          Calls table.getCellClass(rowIndex, colIndex) rowCount times columnCount times.
static java.lang.Object[][] getCells(StaticTableInterface table, int startRowIndex, int startColumnIndex, int rowCount, int columnCount)
          Calls table.getCell(rowIndex, colIndex) rowCount times columnCount times.
static java.lang.Object[] getColumn(StaticTableInterface table, int colIndex)
          Calls table.getCell(rowIndex, colIndex) table.getRowCount() times.
static java.lang.Object[] getColumnLabels(StaticColumnLabelInterface table, int startIndex, int count)
          Calls table.getColumnLabel(colIndex) count times.
static java.lang.Object[] getRow(StaticTableInterface table, int rowIndex)
          Calls table.getCell(rowIndex, colIndex) table.getColumnCount() times.
static java.lang.Object[] getRowLabels(com.sas.table.StaticRowLabelInterface table, int startIndex, int count)
          Calls table.getRowLabel(colIndex) count times.
 

Constructor Detail

StaticTableInterfaceSupport

public StaticTableInterfaceSupport()
Method Detail

countColumns

public static int countColumns(StaticTableInterface table,
                               int maxCount)
                        throws com.sas.table.TableException
Use when your implementation of getColumnCount() does not return -1.

Parameters:
table - Implementation of StaticTableInterface.
maxCount - Ignored.
Returns:
table.getColumnCount()
Throws:
TableException - Propagated from getColumnCount().
See Also:
StaticTableInterface.countColumns(int)

countRows

public static int countRows(StaticTableInterface table,
                            int maxCount)
                     throws com.sas.table.TableException
Use when your implementation of getRowCount() does not return -1.

Parameters:
table - Implementation of StaticTableInterface.
maxCount - Ignored.
Returns:
table.getRowCount()
Throws:
TableException - Propagated from getRowCount().
See Also:
StaticTableInterface.countRows(int)

getCells

public static java.lang.Object[][] getCells(StaticTableInterface table,
                                            int startRowIndex,
                                            int startColumnIndex,
                                            int rowCount,
                                            int columnCount)
                                     throws com.sas.table.TableException
Calls table.getCell(rowIndex, colIndex) rowCount times columnCount times. Use when your implementation can't return a range of cells in a more efficient manner.

Parameters:
table - Implementation of StaticTableInterface.
startRowIndex - A one-based index that identifies the row of the first cell in the range.
startColumnIndex - A one-based index that identifies the column of the first cell in the range.
rowCount - The number of rows in the range.
columnCount - The number of columns in the range.
Returns:
A two-dimensional Object array.
Throws:
TableException - Propagated from getCell().
See Also:
StaticTableInterface.getCells(int, int, int, int)

getCellClasses

public static java.lang.Class[][] getCellClasses(StaticTableInterface table,
                                                 int startRowIndex,
                                                 int startColumnIndex,
                                                 int rowCount,
                                                 int columnCount)
                                          throws com.sas.table.TableException
Calls table.getCellClass(rowIndex, colIndex) rowCount times columnCount times. Use when your implementation can't return a range of cell classes in a more efficient manner.

Parameters:
table - Implementation of StaticTableInterface.
startRowIndex - A one-based index that identifies the row of the first cell in the range.
startColumnIndex - A one-based index that identifies the column of the first cell in the range.
rowCount - The number of rows in the range.
columnCount - The number of columns in the range.
Returns:
A two-dimensional Class array.
Throws:
TableException - Propagated from getCellClass().
See Also:
StaticTableInterface.getCellClasses(int, int, int, int)

getColumn

public static java.lang.Object[] getColumn(StaticTableInterface table,
                                           int colIndex)
                                    throws com.sas.table.TableException
Calls table.getCell(rowIndex, colIndex) table.getRowCount() times. Use when your implementation can't return an entire column in a more efficient manner.

Parameters:
table - Implementation of StaticTableInterface.
colIndex - A one-based index that identifies the column to return.
Returns:
An Object array of the column's cells.
Throws:
TableException - Propagated from getCell().
See Also:
StaticTableInterface.getColumn(int)

getRow

public static java.lang.Object[] getRow(StaticTableInterface table,
                                        int rowIndex)
                                 throws com.sas.table.TableException
Calls table.getCell(rowIndex, colIndex) table.getColumnCount() times. Use when your implementation can't return an entire row in a more efficient manner.

Parameters:
table - Implementation of StaticTableInterface.
rowIndex - A one-based index that identifies the row to return.
Returns:
An Object array of the row's cells.
Throws:
TableException - Propagated from getCell().
See Also:
StaticTableInterface.getRow(int)

getColumnLabels

public static java.lang.Object[] getColumnLabels(StaticColumnLabelInterface table,
                                                 int startIndex,
                                                 int count)
                                          throws com.sas.table.TableException
Calls table.getColumnLabel(colIndex) count times. Use when your implementation can't return a range of column labels in a more efficient manner.

Parameters:
table - Implementation of StaticColumnLabelInterface.
startIndex - A one-based index which identifies the start of the range.
count - The number of labels to return (the extent of the range).
Returns:
The specified columns' labels.
Throws:
TableException - Propagated from getColumnLabel().
See Also:
StaticColumnLabelInterface.getColumnLabels(int, int)

getRowLabels

public static java.lang.Object[] getRowLabels(com.sas.table.StaticRowLabelInterface table,
                                              int startIndex,
                                              int count)
                                       throws com.sas.table.TableException
Calls table.getRowLabel(colIndex) count times. Use when your implementation can't return a range of row labels in a more efficient manner.

Parameters:
table - Implementation of StaticRowLabelInterface.
startIndex - A one-based index which identifies the start of the range.
count - The number of labels to return (the extent of the range).
Returns:
The specified rows' labels.
Throws:
TableException - Propagated from getRowLabel().
See Also:
StaticRowLabelInterface.getRowLabels(int, int)



Copyright © 2009 SAS Institute Inc. All Rights Reserved.