com.sas.table
Interface StaticColumnLabelInterface

All Known Subinterfaces:
ColumnLabelInterface, DataTableInterface
All Known Implementing Classes:
JDBCToDataTableAdapter

public interface StaticColumnLabelInterface

Defines an interface for accessing a table's column labels. This will usually be implemented in tandem with the primary interface to tables, StaticTableInterface.

See Also:
StaticTableInterface, StaticRowLabelInterface, ColumnLabelInterface

Method Summary
 java.lang.Object getColumnLabel(int index)
          Returns the label for a column.
 java.lang.Object[] getColumnLabels(int startIndex, int count)
          Returns the labels for a range of columns.
 boolean isColumnLabelsSupported()
          Indicates whether getColumnLabel() and getColumnLabels() should be called.
 boolean isColumnsLabelSupported()
          Indicates whether there is support for a column labels label, i.e. a label for the set of column labels taken as a whole.
 

Method Detail

getColumnLabel

java.lang.Object getColumnLabel(int index)
                                throws com.sas.table.TableException
Returns the label for a column. The column is identified by a given index.

When isColumnsLabelSupported() is true, getColumnLabel(0) can be used to retrieve the label for the entire set of column labels.

Parameters:
index - A one-based index that identifies the column. See note about use of zero above.
Returns:
The specified column's label.
Throws:
TableException - Thrown if the query can not be satisfied (e.g. i/o-failure).
java.lang.IndexOutOfBoundsException - Thrown if index is negative, zero, or greater than the number of columns. See note about use of zero above.
See Also:
isColumnLabelsSupported(), isColumnsLabelSupported()

getColumnLabels

java.lang.Object[] getColumnLabels(int startIndex,
                                   int count)
                                   throws com.sas.table.TableException
Returns the labels for a range of columns. The range is identified by a given index which defines a starting column and by a given count which defines the extent of the range. The set of labels is returned as an array with each element of the array corresponding to a label in the range.

Parameters:
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 - Thrown if the query can not be satisfied (e.g. i/o-failure).
java.lang.IndexOutOfBoundsException - Thrown if startIndex or count is negative, zero, or greater than the number of columns; except when getColumnCount() has returned -1 -- in that case, the implementation should return an array whose length is less than count and the caller should be prepared for this.
See Also:
StaticTableInterface.getColumnCount(), isColumnLabelsSupported()

isColumnLabelsSupported

boolean isColumnLabelsSupported()
                                throws com.sas.table.TableException
Indicates whether getColumnLabel() and getColumnLabels() should be called. Normally the act of implementing this interface indicates that labels are available, but some implementations may not always have labels available.

Returns:
true if labels are available, and false otherwise.
Throws:
TableException - Thrown if the query can not be satisfied (e.g. i/o-failure).

isColumnsLabelSupported

boolean isColumnsLabelSupported()
                                throws com.sas.table.TableException
Indicates whether there is support for a column labels label, i.e. a label for the set of column labels taken as a whole. For example, a SAS dataset model might use "VARIABLE". If one is supported, getColumnLabel(0) can be used to access it.

Returns:
true if a column labels label is supported, and false otherwise.
Throws:
TableException - Thrown if the query can not be satisfied (e.g. i/o-failure).
See Also:
getColumnLabel(int)



Copyright © 2009 SAS Institute Inc. All Rights Reserved.